mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Fix crash on attempt to compute movement range for siege tower
This commit is contained in:
parent
2685721bf2
commit
907438c6f5
@ -742,7 +742,7 @@ DamageEstimation CBattleInfoCallback::battleEstimateDamage(const battle::Unit *
|
||||
{
|
||||
RETURN_IF_NOT_BATTLE({});
|
||||
auto reachability = battleGetDistances(attacker, attacker->getPosition());
|
||||
int getMovementRange = reachability[attackerPosition];
|
||||
int getMovementRange = attackerPosition.isValid() ? reachability[attackerPosition] : 0;
|
||||
return battleEstimateDamage(attacker, defender, getMovementRange, retaliationDmg);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user