瀏覽代碼

Allow fleeing while having shackles of war when other side got no hero

Dydzio 7 月之前
父節點
當前提交
c216936a59
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      lib/battle/CBattleInfoEssentials.cpp

+ 2 - 2
lib/battle/CBattleInfoEssentials.cpp

@@ -270,7 +270,7 @@ const IBonusBearer * CBattleInfoEssentials::getBonusBearer() const
 bool CBattleInfoEssentials::battleCanFlee(const PlayerColor & player) const
 {
 	RETURN_IF_NOT_BATTLE(false);
-	const auto side = playerToSide(player);
+	const BattleSide side = playerToSide(player);
 	if(side == BattleSide::NONE)
 		return false;
 
@@ -281,7 +281,7 @@ bool CBattleInfoEssentials::battleCanFlee(const PlayerColor & player) const
 		return false;
 
 	//eg. one of heroes is wearing shakles of war
-	if(myHero->hasBonusOfType(BonusType::BATTLE_NO_FLEEING))
+	if(myHero->hasBonusOfType(BonusType::BATTLE_NO_FLEEING) && battleHasHero(otherSide(side)))
 		return false;
 
 	//we are besieged defender