1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-19 21:10:12 +02:00

Backported fix for BattleAI not casting spells that would kill entire

unit
This commit is contained in:
Ivan Savenko 2025-01-04 12:23:36 +00:00
parent 4ccd860b2f
commit c4623aad0f

View File

@ -702,7 +702,7 @@ bool BattleEvaluator::attemptCastingSpell(const CStack * activeStack)
spells::BattleCast cast(state.get(), hero, spells::Mode::HERO, ps.spell);
cast.castEval(state->getServerCallback(), ps.dest);
auto allUnits = state->battleGetUnitsIf([](const battle::Unit * u) -> bool { return u->isValidTarget(); });
auto allUnits = state->battleGetUnitsIf([](const battle::Unit * u) -> bool { return u->isValidTarget(true); });
auto needFullEval = vstd::contains_if(allUnits, [&](const battle::Unit * u) -> bool
{