diff --git a/lib/battle/SideInBattle.cpp b/lib/battle/SideInBattle.cpp index 8dee40f1e..aeafb243c 100644 --- a/lib/battle/SideInBattle.cpp +++ b/lib/battle/SideInBattle.cpp @@ -17,14 +17,17 @@ void SideInBattle::init(const CGHeroInstance * Hero, const CArmedInstance * Army { hero = Hero; armyObject = Army; - color = armyObject->getOwner(); - if(armyObject->ID == Obj::CREATURE_GENERATOR1 - || armyObject->ID == Obj::CREATURE_GENERATOR2 - || armyObject->ID == Obj::CREATURE_GENERATOR3 - || armyObject->ID == Obj::CREATURE_GENERATOR4) + switch(armyObject->ID) { - color = PlayerColor::NEUTRAL; + case Obj::CREATURE_GENERATOR1: + case Obj::CREATURE_GENERATOR2: + case Obj::CREATURE_GENERATOR3: + case Obj::CREATURE_GENERATOR4: + color = PlayerColor::NEUTRAL; + break; + default: + color = armyObject->getOwner(); } if(color == PlayerColor::UNFLAGGABLE)