mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Remove boarded boat as a separate call to player interfaces
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
#include "../lib/CSoundBase.h"
|
||||
#include "../lib/StartInfo.h"
|
||||
#include "../lib/CConfigHandler.h"
|
||||
#include "../lib/mapObjects/MiscObjects.h"
|
||||
#include "../lib/mapObjects/CGMarket.h"
|
||||
#include "../lib/mapObjects/CGTownInstance.h"
|
||||
#include "../lib/gameState/CGameState.h"
|
||||
@@ -478,8 +479,11 @@ void ApplyClientNetPackVisitor::visitRemoveBonus(RemoveBonus & pack)
|
||||
void ApplyFirstClientNetPackVisitor::visitRemoveObject(RemoveObject & pack)
|
||||
{
|
||||
const CGObjectInstance *o = cl.gameInfo().getObj(pack.objectID);
|
||||
const auto * h = dynamic_cast<const CGHeroInstance*>(o);
|
||||
|
||||
GAME->map().onObjectFadeOut(o, pack.initiator);
|
||||
if (h && h->inBoat())
|
||||
GAME->map().onObjectFadeOut(h->getBoat(), pack.initiator);
|
||||
|
||||
//notify interfaces about removal
|
||||
for(auto i=cl.playerint.begin(); i!=cl.playerint.end(); i++)
|
||||
@@ -487,7 +491,11 @@ void ApplyFirstClientNetPackVisitor::visitRemoveObject(RemoveObject & pack)
|
||||
//below line contains little cheat for AI so it will be aware of deletion of enemy heroes that moved or got re-covered by FoW
|
||||
//TODO: loose requirements as next AI related crashes appear, for example another pack.player collects object that got re-covered by FoW, unsure if AI code workarounds this
|
||||
if(gs.isVisibleFor(o, i->first) || (!cl.gameInfo().getPlayerState(i->first)->human && o->ID == Obj::HERO && o->tempOwner != i->first))
|
||||
{
|
||||
i->second->objectRemoved(o, pack.initiator);
|
||||
if (h && h->inBoat())
|
||||
i->second->objectRemoved(h->getBoat(), pack.initiator);
|
||||
}
|
||||
}
|
||||
|
||||
GAME->map().waitForOngoingAnimations();
|
||||
|
||||
Reference in New Issue
Block a user