From fa9abf6adc56082024ccc6b7b8a24d55ba29d9f3 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Wed, 22 Mar 2023 19:49:24 +0200 Subject: [PATCH] Lock UI while adventure map has animations --- client/CPlayerInterface.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index 8924e8e5e..01aa76b06 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -2029,13 +2029,15 @@ bool CPlayerInterface::capturedAllEvents() if (duringMovement) { //just inform that we are capturing events. they will be processed by heroMoved() in client thread. - return true; - } - - if (ignoreEvents) - { - boost::unique_lock un(eventsM); - while(!SDLEventsQueue.empty()) + return true; + } + + bool needToLockAdventureMap = adventureInt->active && CGI->mh->hasOngoingAnimations(); + + if (ignoreEvents || needToLockAdventureMap) + { + boost::unique_lock un(eventsM); + while(!SDLEventsQueue.empty()) { SDLEventsQueue.pop(); }