瀏覽代碼

Fix dismissing hero from opening hero window in town window that is
opened in kindom overview window

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

+ 3 - 3
client/CPlayerInterface.cpp

@@ -404,9 +404,6 @@ void CPlayerInterface::heroKilled(const CGHeroInstance* hero)
 
 	adventureInt->onHeroChanged(hero);
 	localState->erasePath(hero);
-
-	for (auto ki : GH.windows().findWindows<CKingdomInterface>())
-		ki->heroRemoved();
 }
 
 void CPlayerInterface::heroVisit(const CGHeroInstance * visitor, const CGObjectInstance * visitedObj, bool start)
@@ -1489,6 +1486,9 @@ void CPlayerInterface::objectRemovedAfter()
 	// visiting or garrisoned hero removed - recreate castle window
 	if (castleInt)
 		openTownWindow(castleInt->town);
+
+	for (auto ki : GH.windows().findWindows<CKingdomInterface>())
+		ki->heroRemoved();
 }
 
 void CPlayerInterface::playerBlocked(int reason, bool start)