1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Dismissing heroes / minor.

This commit is contained in:
Michał W. Urbańczyk
2008-08-01 21:41:38 +00:00
parent bfad10a8e4
commit 1f4b4364df
8 changed files with 55 additions and 30 deletions

View File

@@ -200,6 +200,17 @@ void CClient::process(int what)
playerint[sr.player]->receivedResource(-1,-1);
break;
}
case 500:
{
RemoveHero rh;
*serv >> rh;
CGHeroInstance *h = static_cast<CGHeroInstance*>(gs->map->objects[rh.id]);
std::cout << "Removing hero with id = "<<(unsigned)rh.id<<std::endl;
CGI->mh->removeObject(h);
gs->apply(&rh);
playerint[h->tempOwner]->heroKilled(h);
break;
}
case 501: //hero movement response - we have to notify interfaces and callback
{
TryMoveHero *th = new TryMoveHero; //will be deleted by callback after processing