diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index ffcf90eca..33040aef8 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -647,6 +647,8 @@ void CPlayerInterface::battleStart(const CCreatureSet *army1, const CCreatureSet autofightingAI->battleStart(army1, army2, int3(0,0,0), hero1, hero2, side); isAutoFightOn = true; cb->registerBattleInterface(autofightingAI); + // Player shouldn't be able to move on adventure map if quick combat is going + adventureInt->quickCombatLock(); } //Don't wait for dialogs when we are non-active hot-seat player @@ -843,6 +845,7 @@ void CPlayerInterface::battleEnd(const BattleResult *br) isAutoFightOn = false; cb->unregisterBattleInterface(autofightingAI); autofightingAI.reset(); + adventureInt->quickCombatUnlock(); if(!battleInt) { diff --git a/client/windows/CAdvmapInterface.cpp b/client/windows/CAdvmapInterface.cpp index 06558f5ad..34f547e1b 100644 --- a/client/windows/CAdvmapInterface.cpp +++ b/client/windows/CAdvmapInterface.cpp @@ -1707,6 +1707,18 @@ void CAdvMapInt::adjustActiveness(bool aiTurnStart) activate(); } +void CAdvMapInt::quickCombatLock() +{ + if(!duringAITurn) + deactivate(); +} + +void CAdvMapInt::quickCombatUnlock() +{ + if(!duringAITurn) + activate(); +} + void CAdvMapInt::changeMode(EAdvMapMode newMode, float newScale /* = 0.4f */) { if (mode != newMode) diff --git a/client/windows/CAdvmapInterface.h b/client/windows/CAdvmapInterface.h index 956bd5d69..9e2bf7be8 100644 --- a/client/windows/CAdvmapInterface.h +++ b/client/windows/CAdvmapInterface.h @@ -224,6 +224,8 @@ public: void aiTurnStarted(); void adjustActiveness(bool aiTurnStart); //should be called every time at AI/human turn transition; blocks GUI during AI turn + void quickCombatLock(); //should be called when quick battle started + void quickCombatUnlock(); void tileLClicked(const int3 &mapPos); void tileHovered(const int3 &mapPos); void tileRClicked(const int3 &mapPos);