From b4c9b81a33620a75b9334ca39b74cebc1cc0dc3b Mon Sep 17 00:00:00 2001 From: DjWarmonger Date: Tue, 25 Jul 2023 10:04:09 +0200 Subject: [PATCH] Update SideInBattle.cpp --- lib/battle/SideInBattle.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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)