1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-22 00:27:58 +02:00

Fixed entering/leaving town.

This commit is contained in:
Michał W. Urbańczyk
2008-08-13 09:28:06 +00:00
parent 59b808f4e1
commit 52f6de2877
7 changed files with 97 additions and 21 deletions

View File

@@ -105,29 +105,19 @@ void CScriptCallback::showCompInfo(ShowInInfobox * comp)
}
void CScriptCallback::heroVisitCastle(int obj, int heroID)
{
//CGTownInstance * n;
//if(n = dynamic_cast<CGTownInstance*>(ob))
//{
// n->visitingHero = CGI->state->map->getHero(heroID,0);
// gh->gs->map->getHero(heroID,0)->visitedTown = n;
// sv->playerint[getHeroOwner(heroID)]->heroVisitsTown(CGI->state->map->getHero(heroID,0),n);
//}
//else
// return;
HeroVisitCastle vc;
vc.hid = heroID;
vc.tid = obj;
vc.flags |= 1;
gh->sendAndApply(&vc);
}
void CScriptCallback::stopHeroVisitCastle(int obj, int heroID)
{
//CGTownInstance * n;
//if(n = dynamic_cast<CGTownInstance*>(ob))
//{
// CGI->state->map->getHero(heroID,0)->visitedTown = NULL;
// if(n->visitingHero && n->visitingHero->type->ID == heroID)
// n->visitingHero = NULL;
// return;
//}
//else
// return;
HeroVisitCastle vc;
vc.hid = heroID;
vc.tid = obj;
gh->sendAndApply(&vc);
}
void CScriptCallback::giveHeroArtifact(int artid, int hid, int position) //pos==-1 - first free slot in backpack
{