diff options
author | KingPin <none@none> | 2008-11-05 20:10:19 -0600 |
---|---|---|
committer | KingPin <none@none> | 2008-11-05 20:10:19 -0600 |
commit | 8d331f2b10cff29ee0571f7056ad353df6a3eabd (patch) | |
tree | 36ef334fec8d6a55f151d40ca5e709880346c219 /src/game/Spell.cpp | |
parent | 404f72c7a2e9c230156e51f8013993b3c8f03d93 (diff) |
[svn] * Avoid access to bag item prototype for getting bag size, use related item update field instead as more fast source.
* Better check client inventory pos data received in some client packets to skip invalid cases.
* Removed some unnecessary database queries.
* Make guid lookup for adding ignore async.
* Added two parameter versions of the AsyncQuery function
* Make queries for adding friends async. - Hunuza
* Replace some PQuery() calls with more simple Query() - Hunuza
* Mark spell as executed instead of deleteable to solve crash.
*** Source mangos.
**Its a big commit. so test with care... or without care.... whatever floats your boat.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Spell.cpp')
-rw-r--r-- | src/game/Spell.cpp | 18 |
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(); +} |