*Use dynamic cast for script cast.
--HG-- branch : trunk
This commit is contained in:
@@ -491,7 +491,7 @@ void ScriptedAI::DoTeleportPlayer(Unit* pUnit, float x, float y, float z, float
|
||||
return;
|
||||
}
|
||||
|
||||
((Player*)pUnit)->TeleportTo(pUnit->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT);
|
||||
CAST_PLR(pUnit)->TeleportTo(pUnit->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT);
|
||||
}
|
||||
|
||||
void ScriptedAI::DoTeleportAll(float x, float y, float z, float o)
|
||||
|
||||
@@ -13,6 +13,15 @@
|
||||
#include "CreatureAIImpl.h"
|
||||
#include "InstanceData.h"
|
||||
|
||||
#define USE_DYNAMIC_CAST
|
||||
#ifdef USE_DYNAMIC_CAST
|
||||
#define CAST_PLR(a) (dynamic_cast<Player*>(a))
|
||||
#define CAST_CRE(a) (dynamic_cast<Creature*>(a))
|
||||
#else
|
||||
#define CAST_PLR(a) (static_cast<Player*>(a))
|
||||
#define CAST_CRE(a) (static_cast<Creature*>(a))
|
||||
#endif
|
||||
|
||||
class ScriptedInstance;
|
||||
|
||||
class SummonList : private std::list<uint64>
|
||||
|
||||
Reference in New Issue
Block a user