diff --git a/client/battle/BattleInterface.cpp b/client/battle/BattleInterface.cpp index e78df4e56..3ad3e62fe 100644 --- a/client/battle/BattleInterface.cpp +++ b/client/battle/BattleInterface.cpp @@ -54,7 +54,6 @@ BattleInterface::BattleInterface(const CCreatureSet *army1, const CCreatureSet * , attackerInt(att) , defenderInt(defen) , curInt(att) - , myTurn(false) , moveSoundHander(-1) { for ( auto & event : animationEvents) @@ -258,6 +257,7 @@ void BattleInterface::giveCommand(EActionType action, BattleHex tile, si32 addit ba->actionSubtype = additional; sendCommand(ba, actor); + CCS->curh->set(Cursor::Combat::POINTER); } void BattleInterface::sendCommand(BattleAction *& command, const CStack * actor) @@ -267,7 +267,6 @@ void BattleInterface::sendCommand(BattleAction *& command, const CStack * actor) if(!tacticsMode) { logGlobal->trace("Setting command for %s", (actor ? actor->nodeName() : "hero")); - myTurn = false; stacksController->setActiveStack(nullptr); givenCommand.setn(command); } @@ -553,7 +552,6 @@ void BattleInterface::activateStack() if(!s) return; - myTurn = true; windowObject->updateQueue(); windowObject->blockUI(false); fieldController->redrawBackgroundWithHexes(); @@ -561,6 +559,11 @@ void BattleInterface::activateStack() GH.fakeMouseMove(); } +bool BattleInterface::makingTurn() const +{ + return stacksController->getActiveStack() != nullptr; +} + void BattleInterface::endAction(const BattleAction* action) { const CStack *stack = curInt->cb->battleGetStackByID(action->stackNumber); diff --git a/client/battle/BattleInterface.h b/client/battle/BattleInterface.h index 394ed3b9c..adec40210 100644 --- a/client/battle/BattleInterface.h +++ b/client/battle/BattleInterface.h @@ -146,7 +146,8 @@ public: static CondSh givenCommand; //data != nullptr if we have i.e. moved current unit - bool myTurn; //if true, interface is active (commands can be ordered) + bool makingTurn() const; + int moveSoundHander; // sound handler used when moving a unit BattleInterface(const CCreatureSet *army1, const CCreatureSet *army2, const CGHeroInstance *hero1, const CGHeroInstance *hero2, std::shared_ptr att, std::shared_ptr defen, std::shared_ptr spectatorInt = nullptr); diff --git a/client/battle/BattleWindow.cpp b/client/battle/BattleWindow.cpp index 4279352bc..9bf24232d 100644 --- a/client/battle/BattleWindow.cpp +++ b/client/battle/BattleWindow.cpp @@ -391,7 +391,7 @@ void BattleWindow::bSpellf() if (owner.actionsController->spellcastingModeActive()) return; - if (!owner.myTurn) + if (!owner.makingTurn()) return; auto myHero = owner.currentHero();