1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-01 00:45:26 +02:00

Merge pull request #3594 from vcmi/fix-3550

#3550 - fix case when unit is in reachability map but only next turn
This commit is contained in:
Andrii Danylchenko
2024-02-04 10:07:44 +02:00
committed by GitHub

View File

@ -843,7 +843,7 @@ bool BattleExchangeEvaluator::checkPositionBlocksOurStacks(HypotheticBattle & hb
} }
} }
if(!reachable && vstd::contains(reachabilityMap[hex], unit)) if(!reachable && std::count(reachabilityMap[hex].begin(), reachabilityMap[hex].end(), unit) > 1)
{ {
blockingScore += ratio * (enemyUnit ? BLOCKING_OWN_ATTACK_PENALTY : BLOCKING_OWN_MOVE_PENALTY); blockingScore += ratio * (enemyUnit ? BLOCKING_OWN_ATTACK_PENALTY : BLOCKING_OWN_MOVE_PENALTY);
} }