瀏覽代碼

Fix excessive removal of dialogs, e.g. new week or timed events

Ivan Savenko 1 年之前
父節點
當前提交
b6cc409772
共有 1 個文件被更改,包括 6 次插入6 次删除
  1. 6 6
      client/CPlayerInterface.cpp

+ 6 - 6
client/CPlayerInterface.cpp

@@ -193,11 +193,6 @@ void CPlayerInterface::closeAllDialogs()
 		castleInt->close();
 
 	castleInt = nullptr;
-
-	// remove all pending dialogs that do not expect query answer
-	vstd::erase_if(dialogs, [](const std::shared_ptr<CInfoWindow> & window){
-		return window->ID == QueryID::NONE;
-	});
 }
 
 void CPlayerInterface::playerEndsTurn(PlayerColor player)
@@ -207,6 +202,11 @@ void CPlayerInterface::playerEndsTurn(PlayerColor player)
 	{
 		makingTurn = false;
 		closeAllDialogs();
+
+		// remove all pending dialogs that do not expect query answer
+		vstd::erase_if(dialogs, [](const std::shared_ptr<CInfoWindow> & window){
+						   return window->ID == QueryID::NONE;
+					   });
 	}
 }
 
@@ -1511,7 +1511,7 @@ void CPlayerInterface::update()
 		return;
 
 	//if there are any waiting dialogs, show them
-	if ((CSH->howManyPlayerInterfaces() <= 1 || makingTurn) && !dialogs.empty() && !showingDialog->isBusy())
+	if (makingTurn && !dialogs.empty() && !showingDialog->isBusy())
 	{
 		showingDialog->setBusy();
 		GH.windows().pushWindow(dialogs.front());