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

BattleAI: fix waited attack calculation

This commit is contained in:
Andrii Danylchenko 2024-07-22 20:37:57 +03:00
parent 33e0eeaa8a
commit 4e83deca92
2 changed files with 6 additions and 0 deletions

View File

@ -230,6 +230,7 @@ EvaluationResult BattleExchangeEvaluator::findBestTarget(
auto hbWaited = std::make_shared<HypotheticBattle>(env.get(), hb);
hbWaited->resetActiveUnit();
hbWaited->getForUpdate(activeStack->unitId())->waiting = true;
hbWaited->getForUpdate(activeStack->unitId())->waitedThisTurn = true;

View File

@ -164,6 +164,11 @@ public:
int64_t getTreeVersion() const;
void resetActiveUnit()
{
activeUnitId = -1;
}
#if SCRIPTING_ENABLED
scripting::Pool * getContextPool() const override;
#endif