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

Fixed #565. Creature components will not get description if they quantity is set to zero.

This commit is contained in:
DjWarmonger
2010-08-17 15:50:17 +00:00
parent 084a0148c7
commit 6c3ad7fcae
5 changed files with 21 additions and 6 deletions

View File

@@ -2875,6 +2875,20 @@ bool CGameHandler::upgradeCreature( ui32 objid, ui8 pos, ui32 upgID )
return true;
}
void CGameHandler::changeCreatureType (int objid, TSlot slot, TCreature creature)
{
CArmedInstance *obj = static_cast<CArmedInstance*>(gs->map->objects[objid]);
if (obj)
{
SetGarrisons sg;
sg.garrs[objid] = obj->getArmy();
sg.garrs[objid].slots[slot].setType(creature);
sendAndApply(&sg);
}
else
tlog2 <<"Illegal call of changeCreatureType for non-armed instance!\n";
}
bool CGameHandler::garrisonSwap( si32 tid )
{
CGTownInstance *town = gs->getTown(tid);