1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-24 03:47:18 +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
commit ec5c44bb92
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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);
}