diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index 8f9b92fcc..1fd72d69f 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -1530,6 +1530,12 @@ void CPlayerInterface::objectRemoved(const CGObjectInstance * obj) } } +void CPlayerInterface::objectRemovedAfter() +{ + EVENT_HANDLER_CALLED_BY_CLIENT; + adventureInt->minimap->update(); +} + void CPlayerInterface::playerBlocked(int reason, bool start) { if(reason == PlayerBlocked::EReason::UPCOMING_BATTLE) diff --git a/client/CPlayerInterface.h b/client/CPlayerInterface.h index febf9748f..01dfff7fe 100644 --- a/client/CPlayerInterface.h +++ b/client/CPlayerInterface.h @@ -176,6 +176,7 @@ public: void centerView (int3 pos, int focusTime) override; void objectPropertyChanged(const SetObjectProperty * sop) override; void objectRemoved(const CGObjectInstance *obj) override; + void objectRemovedAfter() override; void playerBlocked(int reason, bool start) override; void gameOver(PlayerColor player, const EVictoryLossCheckResult & victoryLossCheckResult) override; void playerStartsTurn(PlayerColor player) override; //called before yourTurn on active itnerface diff --git a/client/NetPacksClient.cpp b/client/NetPacksClient.cpp index 014b2a6aa..5ef04afdb 100644 --- a/client/NetPacksClient.cpp +++ b/client/NetPacksClient.cpp @@ -429,6 +429,8 @@ void ApplyFirstClientNetPackVisitor::visitRemoveObject(RemoveObject & pack) void ApplyClientNetPackVisitor::visitRemoveObject(RemoveObject & pack) { cl.invalidatePaths(); + for(auto i=cl.playerint.begin(); i!=cl.playerint.end(); i++) + i->second->objectRemovedAfter(); } void ApplyFirstClientNetPackVisitor::visitTryMoveHero(TryMoveHero & pack) diff --git a/lib/IGameEventsReceiver.h b/lib/IGameEventsReceiver.h index c237c15ac..6b47b3023 100644 --- a/lib/IGameEventsReceiver.h +++ b/lib/IGameEventsReceiver.h @@ -127,6 +127,7 @@ public: virtual void requestRealized(PackageApplied *pa){}; virtual void objectPropertyChanged(const SetObjectProperty * sop){}; //eg. mine has been flagged virtual void objectRemoved(const CGObjectInstance *obj){}; //eg. collected resource, picked artifact, beaten hero + virtual void objectRemovedAfter(){}; //eg. collected resource, picked artifact, beaten hero virtual void playerBlocked(int reason, bool start){}; //reason: 0 - upcoming battle virtual void gameOver(PlayerColor player, const EVictoryLossCheckResult & victoryLossCheckResult) {}; //player lost or won the game virtual void playerStartsTurn(PlayerColor player){}; diff --git a/lib/NetPacksLib.cpp b/lib/NetPacksLib.cpp index 3a262982f..7b7f5f62c 100644 --- a/lib/NetPacksLib.cpp +++ b/lib/NetPacksLib.cpp @@ -2016,7 +2016,7 @@ void NewTurn::applyGs(CGameState *gs) for(const auto & re : res) { - assert(i->first < PlayerColor::PLAYER_LIMIT); + assert(re.first < PlayerColor::PLAYER_LIMIT); gs->getPlayerState(re.first)->resources = re.second; }