diff --git a/client/battle/CBattleInterface.cpp b/client/battle/CBattleInterface.cpp index b59e00b66..030503892 100644 --- a/client/battle/CBattleInterface.cpp +++ b/client/battle/CBattleInterface.cpp @@ -1917,7 +1917,7 @@ void CBattleInterface::blockUI(bool on) canCastSpells = spellcastingProblem == ESpellCastProblem::OK || spellcastingProblem == ESpellCastProblem::MAGIC_IS_BLOCKED; } - bool canWait = activeStack ? !activeStack->waited() : false; + bool canWait = activeStack ? !activeStack->waitedThisTurn : false; bOptions->block(on); bFlee->block(on || !curInt->cb->battleCanFlee()); diff --git a/lib/NetPacksLib.cpp b/lib/NetPacksLib.cpp index 8398349f2..828130373 100644 --- a/lib/NetPacksLib.cpp +++ b/lib/NetPacksLib.cpp @@ -1422,6 +1422,7 @@ DLL_LINKAGE void StartAction::applyGs(CGameState *gs) case EActionType::WAIT: st->defendingAnim = false; st->waiting = true; + st->waitedThisTurn = true; break; case EActionType::HERO_SPELL: //no change in current stack state break; diff --git a/lib/battle/CUnitState.cpp b/lib/battle/CUnitState.cpp index 026e9d711..544f5c132 100644 --- a/lib/battle/CUnitState.cpp +++ b/lib/battle/CUnitState.cpp @@ -476,6 +476,7 @@ CUnitState::CUnitState() movedThisRound(false), summoned(false), waiting(false), + waitedThisTurn(false), casts(this), counterAttacks(this), health(this), @@ -508,6 +509,7 @@ CUnitState & CUnitState::operator=(const CUnitState & other) movedThisRound = other.movedThisRound; summoned = other.summoned; waiting = other.waiting; + waitedThisTurn = other.waitedThisTurn; casts = other.casts; counterAttacks = other.counterAttacks; health = other.health; @@ -727,7 +729,7 @@ bool CUnitState::defended(int turn) const bool CUnitState::moved(int turn) const { - if(!turn) + if(!turn && !waiting) return movedThisRound; else return false; @@ -843,6 +845,7 @@ void CUnitState::serializeJson(JsonSerializeFormat & handler) handler.serializeBool("moved", movedThisRound); handler.serializeBool("summoned", summoned); handler.serializeBool("waiting", waiting); + handler.serializeBool("waitedThisTurn", waitedThisTurn); handler.serializeStruct("casts", casts); handler.serializeStruct("counterAttacks", counterAttacks); @@ -876,6 +879,7 @@ void CUnitState::reset() movedThisRound = false; summoned = false; waiting = false; + waitedThisTurn = false; casts.reset(); counterAttacks.reset(); @@ -946,6 +950,7 @@ void CUnitState::afterNewRound() { defending = false; waiting = false; + waitedThisTurn = false; movedThisRound = false; hadMorale = false; fear = false; diff --git a/lib/battle/CUnitState.h b/lib/battle/CUnitState.h index 110a59115..c5d065084 100644 --- a/lib/battle/CUnitState.h +++ b/lib/battle/CUnitState.h @@ -181,6 +181,7 @@ public: bool movedThisRound; bool summoned; bool waiting; + bool waitedThisTurn; //"waited()" that stays true for full turn after wait - needed as UI button hackfix CCasts casts; CRetaliations counterAttacks;