mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-30 05:43:12 +01:00
Core/Objects: added ToUnit(), ToGameObject() (will be used in future)
Core/Unit: - added SetFacing() function, using proper packet implementetion (spline type) - added GetAuraCount() function (will be used in future) Core/Creature: renamed one unknown type_flag --HG-- branch : trunk
This commit is contained in:
@@ -323,6 +323,10 @@ class Object
|
||||
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; }
|
||||
|
||||
Unit* ToUnit(){ if (GetTypeId() == TYPEID_UNIT || GetTypeId() == TYPEID_PLAYER) return reinterpret_cast<Unit*>(this); else return NULL; }
|
||||
const Unit* ToUnit() const {if (GetTypeId() == TYPEID_UNIT || GetTypeId() == TYPEID_PLAYER) return (const Unit*)((Unit*)this); else return NULL; }
|
||||
GameObject* ToGameObject(){ if (GetTypeId() == TYPEID_GAMEOBJECT) return reinterpret_cast<GameObject*>(this); else return NULL; }
|
||||
const GameObject* ToGameObject() const {if (GetTypeId() == TYPEID_GAMEOBJECT) return (const GameObject*)((GameObject*)this); else return NULL; }
|
||||
protected:
|
||||
|
||||
Object ();
|
||||
|
||||
Reference in New Issue
Block a user