Some Creature* casts moved to new ToCreature.

Added const Creature* ToCreature()

--HG--
branch : trunk
This commit is contained in:
raczman
2010-03-07 18:30:53 +01:00
parent 9a8f10fa30
commit 07f3b91426
29 changed files with 280 additions and 279 deletions
+1
View File
@@ -321,6 +321,7 @@ class Object
Player* ToPlayer(){ if(GetTypeId() == TYPEID_PLAYER) return reinterpret_cast<Player*>(this); else return NULL; }
const Player* ToPlayer() const { if(GetTypeId() == TYPEID_PLAYER) return (const Player*)((Player*)this); else return NULL; }
Creature* ToCreature(){ if(GetTypeId() == TYPEID_UNIT) return reinterpret_cast<Creature*>(this); else return NULL; }
const Creature* ToCreature() const {if(GetTypeId() == TYPEID_UNIT) return (const Creature*)((Creature*)this); else return NULL; }
protected: