ソースを参照

Merge pull request #4491 from IvanSavenko/fixes_157

[1.5.7] Minor fixes
Ivan Savenko 1 年間 前
コミット
fd73116a08
3 ファイル変更10 行追加7 行削除
  1. 3 1
      ChangeLog.md
  2. 6 6
      client/CPlayerInterface.cpp
  3. 1 0
      lib/rewardable/Info.cpp

+ 3 - 1
ChangeLog.md

@@ -3,9 +3,11 @@
 * Fixed game freeze if player is attacked in online multiplayer game by another player when he has unread dialogs, such as new week notification
 * Fixed heroes on map limit game setting not respected when moving hero from town garrison.
 * Add workaround to fix possible crash on attempt to start previously generated random map that has players without owned heroes or towns
-* Fix crash on right-clicking spell icon when receiving unlearnable spells from Pandora
+* Fixed crash on right-clicking spell icon when receiving unlearnable spells from Pandora
 * Fixed possible text overflow in match information box in online lobby
 * Fixed overlapping text in lobby login window
+* Fixed excessive removal of open dialogs such as new week or map events on new turn
+* Fixed objects like Mystical Gardens not resetting their state on new week correctly
 
 # 1.5.5 -> 1.5.6
 

+ 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());

+ 1 - 0
lib/rewardable/Info.cpp

@@ -338,6 +338,7 @@ void Rewardable::Info::configureRewards(
 void Rewardable::Info::configureObject(Rewardable::Configuration & object, CRandomGenerator & rng, IGameCallback * cb) const
 {
 	object.info.clear();
+	object.variables.values.clear();
 
 	configureVariables(object, rng, cb, parameters["variables"]);