1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-04-07 07:10:04 +02:00

Fix updating opponent hero spellpoints in battle window

This commit is contained in:
Dydzio 2023-08-18 20:24:31 +02:00
parent 5da1a6c412
commit 6cb6a6d785
2 changed files with 5 additions and 3 deletions

View File

@ -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)
{

View File

@ -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)