From 6a6e9a225c10e63bd2bf7610658a0d9bb9c59ca9 Mon Sep 17 00:00:00 2001 From: timh52280 <> Date: Thu, 25 Jul 2013 18:02:41 +0200 Subject: Core/Spell: Fix rogue "Glyph of Preparation" Closes #10359 Signed-off-by: Vincent-Michael --- src/server/scripts/Spells/spell_rogue.cpp | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index fd29ab8b1e3..d4e627b7cc1 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -362,31 +362,25 @@ class spell_rog_preparation : public SpellScriptLoader Player* caster = GetCaster()->ToPlayer(); // immediately finishes the cooldown on certain Rogue abilities - const SpellCooldowns& cm = caster->GetSpellCooldownMap(); + SpellCooldowns const& cm = caster->GetSpellCooldownMap(); for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();) { SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); - - if (spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE) - { - if (spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_COLDB_SHADOWSTEP || // Cold Blood, Shadowstep - spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_VAN_EVAS_SPRINT) // Vanish, Evasion, Sprint - caster->RemoveSpellCooldown((itr++)->first, true); - else if (caster->HasAura(SPELL_ROGUE_GLYPH_OF_PREPARATION)) + if (!spellInfo) + continue; + + if (spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE && + (spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_COLDB_SHADOWSTEP || // Cold Blood, Shadowstep + spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG0_ROGUE_VAN_EVAS_SPRINT) || // Vanish, Evasion, Sprint + // Glyph of Preparation + caster->HasAura(SPELL_ROGUE_GLYPH_OF_PREPARATION) && + (spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_DISMANTLE_SMOKE_BOMB || // Dismantle, Smoke Bomb + spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG0_ROGUE_KICK)) // Kick { - if (spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_DISMANTLE || // Dismantle - spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_KICK || // Kick - (spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_BLADE_FLURRY && // Blade Flurry - spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_BLADE_FLURRY)) - caster->RemoveSpellCooldown((itr++)->first, true); - else - ++itr; + caster->RemoveSpellCooldown((itr++)->first, true); } else ++itr; - } - else - ++itr; } } -- cgit v1.2.3