diff options
Diffstat (limited to 'src/server/game/Entities/DynamicObject')
| -rw-r--r-- | src/server/game/Entities/DynamicObject/DynamicObject.cpp | 26 | ||||
| -rw-r--r-- | src/server/game/Entities/DynamicObject/DynamicObject.h | 4 |
2 files changed, 20 insertions, 10 deletions
diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.cpp b/src/server/game/Entities/DynamicObject/DynamicObject.cpp index b9be22478f6..87603080ada 100644 --- a/src/server/game/Entities/DynamicObject/DynamicObject.cpp +++ b/src/server/game/Entities/DynamicObject/DynamicObject.cpp @@ -16,19 +16,22 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "DynamicObject.h" #include "Common.h" -#include "UpdateMask.h" -#include "World.h" -#include "ObjectAccessor.h" -#include "DatabaseEnv.h" #include "GameTime.h" -#include "GridNotifiers.h" -#include "GridNotifiersImpl.h" +#include "Log.h" +#include "Map.h" +#include "ObjectAccessor.h" +#include "Player.h" +#include "SpellAuras.h" +#include "SpellMgr.h" #include "ScriptMgr.h" #include "Transport.h" +#include "Unit.h" +#include "UpdateData.h" DynamicObject::DynamicObject(bool isWorldObject) : WorldObject(isWorldObject), - _aura(NULL), _removedAura(NULL), _caster(NULL), _duration(0), _isViewpoint(false) + _aura(nullptr), _removedAura(nullptr), _caster(nullptr), _duration(0), _isViewpoint(false) { m_objectType |= TYPEMASK_DYNAMICOBJECT; m_objectTypeId = TYPEID_DYNAMICOBJECT; @@ -204,7 +207,7 @@ void DynamicObject::RemoveAura() { ASSERT(_aura && !_removedAura); _removedAura = _aura; - _aura = NULL; + _aura = nullptr; if (!_removedAura->IsRemoved()) _removedAura->_Remove(AURA_REMOVE_BY_DEFAULT); } @@ -240,5 +243,10 @@ void DynamicObject::UnbindFromCaster() { ASSERT(_caster); _caster->_UnregisterDynObject(this); - _caster = NULL; + _caster = nullptr; +} + +SpellInfo const* DynamicObject::GetSpellInfo() const +{ + return sSpellMgr->GetSpellInfo(GetSpellId()); } diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.h b/src/server/game/Entities/DynamicObject/DynamicObject.h index 4eb6cb0dcca..94bb0d8bc8d 100644 --- a/src/server/game/Entities/DynamicObject/DynamicObject.h +++ b/src/server/game/Entities/DynamicObject/DynamicObject.h @@ -20,6 +20,7 @@ #define TRINITYCORE_DYNAMICOBJECT_H #include "Object.h" +#include "MapObject.h" class Unit; class Aura; @@ -54,7 +55,8 @@ class TC_GAME_API DynamicObject : public WorldObject, public GridObject<DynamicO Unit* GetCaster() const { return _caster; } void BindToCaster(); void UnbindFromCaster(); - uint32 GetSpellId() const { return GetUInt32Value(DYNAMICOBJECT_SPELLID); } + uint32 GetSpellId() const { return GetUInt32Value(DYNAMICOBJECT_SPELLID); } + SpellInfo const* GetSpellInfo() const; ObjectGuid GetCasterGUID() const { return GetGuidValue(DYNAMICOBJECT_CASTER); } float GetRadius() const { return GetFloatValue(DYNAMICOBJECT_RADIUS); } |
