mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-03 13:01:33 +02:00
BattleAI: fix waited attack calculation
This commit is contained in:
parent
33e0eeaa8a
commit
4e83deca92
@ -230,6 +230,7 @@ EvaluationResult BattleExchangeEvaluator::findBestTarget(
|
|||||||
|
|
||||||
auto hbWaited = std::make_shared<HypotheticBattle>(env.get(), hb);
|
auto hbWaited = std::make_shared<HypotheticBattle>(env.get(), hb);
|
||||||
|
|
||||||
|
hbWaited->resetActiveUnit();
|
||||||
hbWaited->getForUpdate(activeStack->unitId())->waiting = true;
|
hbWaited->getForUpdate(activeStack->unitId())->waiting = true;
|
||||||
hbWaited->getForUpdate(activeStack->unitId())->waitedThisTurn = true;
|
hbWaited->getForUpdate(activeStack->unitId())->waitedThisTurn = true;
|
||||||
|
|
||||||
|
@ -164,6 +164,11 @@ public:
|
|||||||
|
|
||||||
int64_t getTreeVersion() const;
|
int64_t getTreeVersion() const;
|
||||||
|
|
||||||
|
void resetActiveUnit()
|
||||||
|
{
|
||||||
|
activeUnitId = -1;
|
||||||
|
}
|
||||||
|
|
||||||
#if SCRIPTING_ENABLED
|
#if SCRIPTING_ENABLED
|
||||||
scripting::Pool * getContextPool() const override;
|
scripting::Pool * getContextPool() const override;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user