diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-12-28 14:56:01 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-12-28 14:56:01 -0800 |
commit | 90ff8e672b911f17bb7849f9d8316577b3ed59cf (patch) | |
tree | 458ede74b21e26fd881872f67f28783a94d29c96 /equipment.c | |
parent | a375159e6a13bb971c07ce770af329b64b46ba6d (diff) | |
download | subsurface-90ff8e672b911f17bb7849f9d8316577b3ed59cf.tar.gz |
Update tank model with custom tanks used in XML files
Fixes #377
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'equipment.c')
-rw-r--r-- | equipment.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/equipment.c b/equipment.c index 240e92681..133bef2b2 100644 --- a/equipment.c +++ b/equipment.c @@ -13,11 +13,20 @@ void add_cylinder_description(cylinder_type_t *type) { const char *desc; + int i; desc = type->description; if (!desc) return; - /* now do something with it... */ + for (i = 0; i < 100 && tank_info[i].name != NULL; i++) { + if (strcmp(tank_info[i].name, desc) == 0) + return; + } + if (i < 100) { + tank_info[i].name = desc; + tank_info[i].ml = type->size.mliter; + tank_info[i].bar = type->workingpressure.mbar / 1000; + } } void add_weightsystem_description(weightsystem_t *weightsystem) { |