mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +02:00
Fix crash on sieging Citadel or Castle
This commit is contained in:
parent
7fa45f5f89
commit
0e4be8c776
@ -621,6 +621,9 @@ BattleScore BattleExchangeEvaluator::calculateExchange(
|
|||||||
if(!exchangeBattle->getForUpdate(u->unitId())->alive())
|
if(!exchangeBattle->getForUpdate(u->unitId())->alive())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (!u->getPosition().isValid())
|
||||||
|
return false; // e.g. tower shooters
|
||||||
|
|
||||||
return vstd::contains_if(reachabilityMap.at(u->getPosition()), [&attacker](const battle::Unit * other) -> bool
|
return vstd::contains_if(reachabilityMap.at(u->getPosition()), [&attacker](const battle::Unit * other) -> bool
|
||||||
{
|
{
|
||||||
return attacker->unitId() == other->unitId();
|
return attacker->unitId() == other->unitId();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user