1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Improved map view selection tracking

This commit is contained in:
Ivan Savenko
2023-02-22 22:06:27 +02:00
parent b9056ef248
commit fbb8c18c23
4 changed files with 58 additions and 14 deletions

View File

@@ -572,16 +572,12 @@ void ApplyClientNetPackVisitor::visitHeroRecruited(HeroRecruited & pack)
logNetwork->error("Something wrong with hero recruited!");
}
bool needsPrinting = true;
if(callInterfaceIfPresent(cl, h->tempOwner, &IGameEventsReceiver::heroCreated, h))
{
if(const CGTownInstance *t = gs.getTown(pack.tid))
{
callInterfaceIfPresent(cl, h->tempOwner, &IGameEventsReceiver::heroInGarrisonChange, t);
needsPrinting = false;
}
}
if(needsPrinting && CGI->mh)
if(CGI->mh)
CGI->mh->onObjectInstantAdd(h);
}