1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-01 00:45:26 +02:00

Commander can now die in a battle and will be automatically rised when visiting town.

This commit is contained in:
DjWarmonger
2012-07-17 08:52:27 +00:00
parent 9ebf56ff03
commit b86706d58c
4 changed files with 34 additions and 5 deletions

View File

@ -2046,7 +2046,17 @@ void CGTownInstance::onHeroVisit(const CGHeroInstance * h) const
}
}
else
{
if (h->commander && !h->commander->alive) //rise commander. TODO: interactive script
{
SetCommanderProperty scp;
scp.heroid = h->id;
scp.which = SetCommanderProperty::ALIVE;
scp.amount = 1;
cb->sendAndApply (&scp);
}
cb->heroVisitCastle(id, h->id);
}
}
void CGTownInstance::onHeroLeave(const CGHeroInstance * h) const