diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index f48145de7..9f982fa30 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -5414,34 +5414,27 @@ void CGameHandler::runBattle() continue; } - if(next->getCreature()->idNumber == CreatureID::CATAPULT && (!curOwner || curOwner->getSecSkillLevel(SecondarySkill::BALLISTICS) == 0)) //catapult, hero has no ballistics + if( next->getCreature()->idNumber == CreatureID::CATAPULT ) { const auto & attackableBattleHexes = curB.getAttackableBattleHexes(); - if(!attackableBattleHexes.empty()) + if(attackableBattleHexes.empty()) + { + makeStackDoNothing(next); + continue; + } + + if(!curOwner || curOwner->getSecSkillLevel(SecondarySkill::BALLISTICS) == 0) { BattleAction attack; - attack.destinationTile = *RandomGeneratorUtil::nextItem(attackableBattleHexes, gs->getRandomGenerator()); + attack.destinationTile = *RandomGeneratorUtil::nextItem(attackableBattleHexes, + gs->getRandomGenerator()); attack.actionType = Battle::CATAPULT; attack.additionalInfo = 0; attack.side = !next->attackerOwned; attack.stackNumber = next->ID; makeAutomaticAction(next, attack); - } - else - { - makeStackDoNothing(next); - } - continue; - } - - if( next->getCreature()->idNumber == CreatureID::CATAPULT - && curOwner && curOwner->getSecSkillLevel(SecondarySkill::BALLISTICS) > 0) - { - if(curB.getAttackableBattleHexes().empty()) - { - makeStackDoNothing(next); continue; } }