aboutsummaryrefslogtreecommitdiff
path: root/src/game/Spell.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Spell.cpp')
-rw-r--r--src/game/Spell.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 7b4c855474c..1ee787d042e 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -287,7 +287,8 @@ Spell::Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 origi
m_triggeringContainer = triggeringContainer;
m_magnetPair.first = false;
m_magnetPair.second = NULL;
- m_deletable = true;
+ m_referencedFromCurrentSpell = false;
+ m_executedCurrently = false;
m_delayAtDamageCount = 0;
m_applyMultiplierMask = 0;
@@ -2201,6 +2202,8 @@ void Spell::cancel()
void Spell::cast(bool skipCheck)
{
+ SetExecutedCurrently(true);
+
uint8 castResult = 0;
// update pointers base at GUIDs to prevent access to non-existed already object
@@ -2210,6 +2213,7 @@ void Spell::cast(bool skipCheck)
if(!m_targets.getUnitTarget() && m_targets.getUnitTargetGUID() && m_targets.getUnitTargetGUID() != m_caster->GetGUID())
{
cancel();
+ SetExecutedCurrently(false);
return;
}
@@ -2221,6 +2225,7 @@ void Spell::cast(bool skipCheck)
{
SendCastResult(castResult);
finish(false);
+ SetExecutedCurrently(false);
return;
}
@@ -2232,6 +2237,7 @@ void Spell::cast(bool skipCheck)
{
SendCastResult(castResult);
finish(false);
+ SetExecutedCurrently(false);
return;
}
}
@@ -2277,7 +2283,10 @@ void Spell::cast(bool skipCheck)
TakeReagents(); // we must remove reagents before HandleEffects to allow place crafted item in same slot
if(m_spellState == SPELL_STATE_FINISHED) // stop cast if spell marked as finish somewhere in Take*/FillTargetMap
+ {
+ SetExecutedCurrently(false);
return;
+ }
SendCastResult(castResult);
SendSpellGo(); // we must send smsg_spell_go packet before m_castItem delete in TakeCastItem()...
@@ -2309,6 +2318,8 @@ void Spell::cast(bool skipCheck)
// Immediate spell, no big deal
handle_immediate();
}
+
+ SetExecutedCurrently(false);
}
void Spell::handle_immediate()
@@ -5126,3 +5137,8 @@ void SpellEvent::Abort(uint64 /*e_time*/)
if (m_Spell->getState() != SPELL_STATE_FINISHED)
m_Spell->cancel();
}
+
+bool SpellEvent::IsDeletable() const
+{
+ return m_Spell->IsDeletable();
+}