From 2d3e04f4132784571b4f3ed05486c4fda0769876 Mon Sep 17 00:00:00 2001 From: SoftCoder Date: Sun, 22 Dec 2013 21:03:40 -0800 Subject: [PATCH] - a few more minor code quality fixes --- source/glest_game/types/skill_type.cpp | 6 +++--- source/glest_game/world/map.cpp | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/source/glest_game/types/skill_type.cpp b/source/glest_game/types/skill_type.cpp index b71e07aa..be42324a 100644 --- a/source/glest_game/types/skill_type.cpp +++ b/source/glest_game/types/skill_type.cpp @@ -208,8 +208,8 @@ string AttackBoost::getDesc(bool translatedValue) const{ void AttackBoost::loadGame(const XmlNode *rootNode, Faction *faction, const SkillType *skillType) { const XmlNode *attackBoostNode = rootNode->getChild("AttackBoost"); - enabled = attackBoostNode->getAttribute("enabled")->getIntValue(); - allowMultipleBoosts = attackBoostNode->getAttribute("allowMultipleBoosts")->getIntValue(); + enabled = (attackBoostNode->getAttribute("enabled")->getIntValue() != 0); + allowMultipleBoosts = (attackBoostNode->getAttribute("allowMultipleBoosts")->getIntValue() != 0); radius = attackBoostNode->getAttribute("radius")->getIntValue(); targetType = static_cast(attackBoostNode->getAttribute("targetType")->getIntValue()); @@ -234,7 +234,7 @@ void AttackBoost::loadGame(const XmlNode *rootNode, Faction *faction, const Skil unitParticleSystemTypeForAffectedUnit = new UnitParticleSystemType(); unitParticleSystemTypeForAffectedUnit->loadGame(attackBoostNode); - includeSelf = attackBoostNode->getAttribute("includeSelf")->getIntValue(); + includeSelf = (attackBoostNode->getAttribute("includeSelf")->getIntValue() != 0); name = attackBoostNode->getAttribute("name")->getValue(); } diff --git a/source/glest_game/world/map.cpp b/source/glest_game/world/map.cpp index ff5090fd..4c276bfb 100644 --- a/source/glest_game/world/map.cpp +++ b/source/glest_game/world/map.cpp @@ -501,9 +501,6 @@ Checksum Map::load(const string &path, TechTree *techTree, Tileset *tileset) { if(f) fclose(f); } else { - if(f) fclose(f); - f = NULL; - throw megaglest_runtime_error("Can't open file"); } }