/// <summary> /// Ensures that the SpellCollection exists (not all NPCs have Spells) /// </summary> public SpellCollection EnsureSpells() { if (!HasSpells && this is NPC) { m_spells = new NPCSpellCollection((NPC)this); } return m_spells; }
public override void Dispose(bool disposing) { if (m_auras == null) { // already disposed return; } if (m_Movement != null) { m_Movement.m_owner = null; m_Movement = null; } base.Dispose(disposing); m_attackTimer = null; if (m_target != null) { OnTargetNull(); m_target = null; } if (m_regenTimer != null) { m_regenTimer.Dispose(); } if (m_brain != null) { m_brain.Dispose(); m_brain = null; } if (m_spells != null) { m_spells.Owner = null; m_spells = null; } m_auras.Owner = null; m_auras = null; if (m_areaAura != null) { m_areaAura.Holder = null; m_areaAura = null; } m_charm = null; m_channeled = null; }
public override void Dispose(bool disposing) { if (m_auras == null) { // already disposed return; } if (m_Movement != null) { m_Movement.m_owner = null; m_Movement = null; } base.Dispose(disposing); m_attackTimer = null; m_target = null; if (m_brain != null) { m_brain.Dispose(); m_brain = null; } m_spells.Recycle(); m_spells = null; m_auras.Owner = null; m_auras = null; m_charm = null; m_channeled = null; }