Revert changes done in r0074e32c2f and r4d86e4199a - fixes buildissues ( if()+reinterpret_cast is faster than dynamic_casts btw )

--HG--
branch : trunk
This commit is contained in:
click
2010-08-06 03:00:39 +02:00
parent 71ef21de21
commit 0caaa3e478
8 changed files with 14 additions and 105 deletions
+4 -10
View File
@@ -116,8 +116,6 @@ class CreatureAI;
class ZoneScript;
class Unit;
class Transport;
class Item;
typedef UNORDERED_MAP<Player*, UpdateData> UpdateDataMapType;
@@ -321,14 +319,10 @@ class Object
// FG: some hacky helpers
void ForceValuesUpdateAtIndex(uint32);
Unit* ToUnit();
const Unit* ToUnit() const;
Player* ToPlayer();
const Player* ToPlayer() const;
Creature* ToCreature();
const Creature* ToCreature() const;
Item* ToItem();
const Item* ToItem() const;
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: