*Cleanup in single target auras (thanks to JuliuSZS some useable debug info)

*Add ToInstanceMap() and ToMapInstanced() typecast functions and CAST_INST macro to use in scripts.

--HG--
branch : trunk
This commit is contained in:
QAston
2010-07-31 01:41:32 +02:00
parent 1ab415cc06
commit e5881d9590
8 changed files with 26 additions and 25 deletions
+8
View File
@@ -51,6 +51,8 @@ struct ScriptInfo;
struct ScriptAction;
struct Position;
class BattleGround;
class MapInstanced;
class InstanceMap;
//******************************************
// Map file format defines
@@ -446,6 +448,12 @@ class Map : public GridRefManager<NGridType>
Creature* GetCreature(uint64 guid);
GameObject* GetGameObject(uint64 guid);
DynamicObject* GetDynamicObject(uint64 guid);
MapInstanced* ToMapInstanced(){ if (Instanceable()) return reinterpret_cast<MapInstanced*>(this); else return NULL; }
const MapInstanced* ToMapInstanced() const { if (Instanceable()) return (const MapInstanced*)((MapInstanced*)this); else return NULL; }
InstanceMap* ToInstanceMap(){ if (IsDungeon()) return reinterpret_cast<InstanceMap*>(this); else return NULL; }
const InstanceMap* ToInstanceMap() const { if (IsDungeon()) return (const InstanceMap*)((InstanceMap*)this); else return NULL; }
private:
void LoadMapAndVMap(int gx, int gy);
void LoadVMap(int gx, int gy);