浏览代码

Lock UI while adventure map has animations

Ivan Savenko 2 年之前
父节点
当前提交
fa9abf6adc
共有 1 个文件被更改,包括 9 次插入7 次删除
  1. 9 7
      client/CPlayerInterface.cpp

+ 9 - 7
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<boost::mutex> un(eventsM);
-		while(!SDLEventsQueue.empty())
+		return true;
+	}
+
+	bool needToLockAdventureMap = adventureInt->active && CGI->mh->hasOngoingAnimations();
+
+	if (ignoreEvents || needToLockAdventureMap)
+	{
+		boost::unique_lock<boost::mutex> un(eventsM);
+		while(!SDLEventsQueue.empty())
 		{
 			SDLEventsQueue.pop();
 		}