1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Lock UI while adventure map has animations

This commit is contained in:
Ivan Savenko
2023-03-22 19:49:24 +02:00
parent 54e8abb3eb
commit fa9abf6adc

View File

@@ -2029,13 +2029,15 @@ bool CPlayerInterface::capturedAllEvents()
if (duringMovement) if (duringMovement)
{ {
//just inform that we are capturing events. they will be processed by heroMoved() in client thread. //just inform that we are capturing events. they will be processed by heroMoved() in client thread.
return true; return true;
} }
if (ignoreEvents) bool needToLockAdventureMap = adventureInt->active && CGI->mh->hasOngoingAnimations();
{
boost::unique_lock<boost::mutex> un(eventsM); if (ignoreEvents || needToLockAdventureMap)
while(!SDLEventsQueue.empty()) {
boost::unique_lock<boost::mutex> un(eventsM);
while(!SDLEventsQueue.empty())
{ {
SDLEventsQueue.pop(); SDLEventsQueue.pop();
} }