1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

CGameHandler: use ObjProperty enum instead of magic numbers

This commit is contained in:
Arseniy Shestakov 2016-09-09 17:42:16 +03:00
parent 41abce102e
commit 6747555339

View File

@ -1913,7 +1913,7 @@ void CGameHandler::giveSpells(const CGTownInstance *t, const CGHeroInstance *h)
void CGameHandler::setBlockVis(ObjectInstanceID objid, bool bv)
{
SetObjectProperty sop(objid,2,bv);
SetObjectProperty sop(objid, ObjProperty::BLOCKVIS, bv);
sendAndApply(&sop);
}
@ -1935,7 +1935,7 @@ bool CGameHandler::removeObject( const CGObjectInstance * obj )
void CGameHandler::setAmount(ObjectInstanceID objid, ui32 val)
{
SetObjectProperty sop(objid,3,val);
SetObjectProperty sop(objid, ObjProperty::PRIMARY_STACK_COUNT, val);
sendAndApply(&sop);
}
@ -2151,7 +2151,7 @@ bool CGameHandler::teleportHero(ObjectInstanceID hid, ObjectInstanceID dstid, ui
void CGameHandler::setOwner(const CGObjectInstance * obj, PlayerColor owner)
{
PlayerColor oldOwner = getOwner(obj->id);
SetObjectProperty sop(obj->id, 1, owner.getNum());
SetObjectProperty sop(obj->id, ObjProperty::OWNER, owner.getNum());
sendAndApply(&sop);
std::set<PlayerColor> playerColors = {owner, oldOwner};