Core/Spells: Fix a crash on checking school immunity added to unit manually (not by aura)

This commit is contained in:
QAston
2011-07-28 23:41:29 +02:00
parent 045dec19fa
commit 07badd7385
9 changed files with 485 additions and 168 deletions
+10 -16
View File
@@ -133,10 +133,16 @@ class SpellCastTargets
uint32 GetTargetMask() const { return m_targetMask; }
void SetTargetMask(uint32 newMask) { m_targetMask = newMask; }
uint64 GetUnitTargetGUID() const { return m_unitTargetGUID; }
Unit* GetUnitTarget() const { return m_unitTarget; }
uint64 GetObjectTargetGUID() const { return m_objectTargetGUID; }
WorldObject * GetObjectTarget() const { return m_objectTarget; }
Unit* GetUnitTarget() const { return m_objectTarget ? m_objectTarget->ToUnit() : NULL; }
void SetUnitTarget(Unit* target);
GameObject* GetGOTarget() const { return m_objectTarget ? m_objectTarget->ToUnit() : NULL;; }
void SetGOTarget(GameObject* target);
void SetCorpseTarget(Corpse* corpse);
Position const* GetSrc() const;
void SetSrc(float x, float y, float z);
void SetSrc(Position const& pos);
@@ -150,13 +156,6 @@ class SpellCastTargets
void SetDst(SpellCastTargets const& spellTargets);
void ModDst(Position const& pos);
uint64 GetGOTargetGUID() const { return m_GOTargetGUID; }
GameObject* GetGOTarget() const { return m_GOTarget; }
void SetGOTarget(GameObject* target);
uint64 GetCorpseTargetGUID() const { return m_CorpseTargetGUID; }
void SetCorpseTarget(Corpse* corpse);
uint64 GetItemTargetGUID() const { return m_itemTargetGUID; }
Item* GetItemTarget() const { return m_itemTarget; }
uint32 GetItemTargetEntry() const { return m_itemTargetEntry; }
@@ -184,15 +183,10 @@ class SpellCastTargets
private:
uint32 m_targetMask;
// objects (can be used at spell creating and after Update at casting
Unit* m_unitTarget;
GameObject* m_GOTarget;
Item* m_itemTarget;
WorldObject* m_objectTarget; // can be used at spell creating and after Update
// object GUID/etc, can be used always
uint64 m_unitTargetGUID;
uint64 m_GOTargetGUID;
uint64 m_CorpseTargetGUID;
uint64 m_objectTargetGUID;
uint64 m_itemTargetGUID;
uint32 m_itemTargetEntry;