1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-01 12:57:51 +02:00

Merge pull request #229 from vmarkovtsev/develop

Fix freshly recruited hero phantom in castle entrance
This commit is contained in:
ArseniyShestakov 2016-10-02 18:26:40 +03:00 committed by GitHub
commit 1c2a40592a
2 changed files with 10 additions and 4 deletions

View File

@ -494,13 +494,19 @@ void HeroRecruited::applyCl( CClient *cl )
logNetwork->errorStream() << "Something wrong with hero recruited!";
}
CGI->mh->printObject(h);
if(vstd::contains(cl->playerint,h->tempOwner))
bool needsPrinting = true;
if(vstd::contains(cl->playerint, h->tempOwner))
{
cl->playerint[h->tempOwner]->heroCreated(h);
if(const CGTownInstance *t = GS(cl)->getTown(tid))
{
cl->playerint[h->tempOwner]->heroInGarrisonChange(t);
needsPrinting = false;
}
}
if (needsPrinting)
{
CGI->mh->printObject(h);
}
}

View File

@ -386,7 +386,7 @@ public:
void getTerrainDescr(const int3 &pos, std::string & out, bool terName); //if tername == false => empty string when tile is clear
CGObjectInstance * createObject(int id, int subid, int3 pos, int owner=254); //creates a new object with a certain id and subid
bool printObject(const CGObjectInstance * obj, bool fadein = false); //puts appropriate things to ttiles, so obj will be visible on map
bool printObject(const CGObjectInstance * obj, bool fadein = false); //puts appropriate things to tiles, so obj will be visible on map
bool hideObject(const CGObjectInstance * obj, bool fadeout = false); //removes appropriate things from ttiles, so obj will be no longer visible on map (but still will exist)
bool removeObject(CGObjectInstance * obj, bool fadeout = false); //removes object from each place in VCMI (I hope)
void init();