mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
Allow fleeing while having shackles of war when other side got no hero
This commit is contained in:
@@ -270,7 +270,7 @@ const IBonusBearer * CBattleInfoEssentials::getBonusBearer() const
|
|||||||
bool CBattleInfoEssentials::battleCanFlee(const PlayerColor & player) const
|
bool CBattleInfoEssentials::battleCanFlee(const PlayerColor & player) const
|
||||||
{
|
{
|
||||||
RETURN_IF_NOT_BATTLE(false);
|
RETURN_IF_NOT_BATTLE(false);
|
||||||
const auto side = playerToSide(player);
|
const BattleSide side = playerToSide(player);
|
||||||
if(side == BattleSide::NONE)
|
if(side == BattleSide::NONE)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -281,7 +281,7 @@ bool CBattleInfoEssentials::battleCanFlee(const PlayerColor & player) const
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
//eg. one of heroes is wearing shakles of war
|
//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;
|
return false;
|
||||||
|
|
||||||
//we are besieged defender
|
//we are besieged defender
|
||||||
|
|||||||
Reference in New Issue
Block a user