From 870d50648f1fff4a53172f2dafb204c62d42e06b Mon Sep 17 00:00:00 2001 From: Unholychick Date: Mon, 26 Jan 2015 23:33:51 +0100 Subject: Scripts/Spells: Fix some faulty code in spell_dk.cpp thanks to @joschiwald --- src/server/game/Entities/Unit/Unit.cpp | 24 ++++++++++++++++++++++++ src/server/game/Entities/Unit/Unit.h | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) (limited to 'src/server/game/Entities/Unit') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a2adb6a320c..b87b9d444ea 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -161,6 +161,30 @@ ProcEventInfo::ProcEventInfo(Unit* actor, Unit* actionTarget, Unit* procTarget, _damageInfo(damageInfo), _healInfo(healInfo) { } +SpellInfo const* ProcEventInfo::GetSpellInfo() const +{ + /// WORKAROUND: unfinished new proc system + if (_spell) + return _spell->GetSpellInfo(); + if (_damageInfo) + return _damageInfo->GetSpellInfo(); + /*if (_healInfo) + return _healInfo->GetSpellInfo();*/ + return nullptr; +} + +SpellSchoolMask ProcEventInfo::GetSchoolMask() const +{ + /// WORKAROUND: unfinished new proc system + if (_spell) + return _spell->GetSpellInfo()->GetSchoolMask(); + if (_damageInfo) + return _damageInfo->GetSchoolMask(); + /*if (_healInfo) + return _healInfo->GetSchoolMask();*/ + return SPELL_SCHOOL_MASK_NONE; +} + Unit::Unit(bool isWorldObject) : WorldObject(isWorldObject), m_movedPlayer(NULL), m_lastSanctuaryTime(0), IsAIEnabled(false), NeedChangeAI(false), LastCharmerGUID(), diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 1b8c188afb4..cc9027e10c9 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -978,8 +978,8 @@ public: uint32 GetSpellPhaseMask() const { return _spellPhaseMask; } uint32 GetHitMask() const { return _hitMask; } - SpellInfo const* GetSpellInfo() const { return NULL; } - SpellSchoolMask GetSchoolMask() const { return SPELL_SCHOOL_MASK_NONE; } + SpellInfo const* GetSpellInfo() const; + SpellSchoolMask GetSchoolMask() const; DamageInfo* GetDamageInfo() const { return _damageInfo; } HealInfo* GetHealInfo() const { return _healInfo; } -- cgit v1.2.3