瀏覽代碼

Fix updating opponent hero spellpoints in battle window

Dydzio 2 年之前
父節點
當前提交
6cb6a6d785
共有 2 個文件被更改,包括 5 次插入3 次删除
  1. 0 3
      client/CPlayerInterface.cpp
  2. 5 0
      client/NetPacksClient.cpp

+ 0 - 3
client/CPlayerInterface.cpp

@@ -476,9 +476,6 @@ void CPlayerInterface::heroManaPointsChanged(const CGHeroInstance * hero)
 	adventureInt->onHeroChanged(hero);
 	if (makingTurn && hero->tempOwner == playerID)
 		adventureInt->onHeroChanged(hero);
-
-	for (auto window : GH.windows().findWindows<BattleWindow>())
-		window->heroManaPointsChanged(hero);
 }
 void CPlayerInterface::heroMovePointsChanged(const CGHeroInstance * hero)
 {

+ 5 - 0
client/NetPacksClient.cpp

@@ -17,7 +17,9 @@
 #include "mapView/mapHandler.h"
 #include "adventureMap/CInGameConsole.h"
 #include "battle/BattleInterface.h"
+#include "battle/BattleWindow.h"
 #include "gui/CGuiHandler.h"
+#include "gui/WindowHandler.h"
 #include "widgets/MiscWidgets.h"
 #include "CMT.h"
 #include "CServerHandler.h"
@@ -153,6 +155,9 @@ void ApplyClientNetPackVisitor::visitSetMana(SetMana & pack)
 {
 	const CGHeroInstance *h = cl.getHero(pack.hid);
 	callInterfaceIfPresent(cl, h->tempOwner, &IGameEventsReceiver::heroManaPointsChanged, h);
+
+	for (auto window : GH.windows().findWindows<BattleWindow>())
+		window->heroManaPointsChanged(h);
 }
 
 void ApplyClientNetPackVisitor::visitSetMovePoints(SetMovePoints & pack)