From 72b73d2cb9c6835635f46eefa9ca39b8468e1542 Mon Sep 17 00:00:00 2001 From: "Az@zel" Date: Tue, 7 Jun 2011 16:04:15 +0600 Subject: Scripts/Scarlet Enclave: fix stolen effect for DK quest, which allowed to hang server by spawning unlimited number of mobs --- .../scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index c046b6a3a88..0477b41dacd 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -633,12 +633,15 @@ public: { if (Unit *charmer = caster->GetCharmer()) { - charmer->RemoveAurasDueToSpell(EFFECT_STOLEN_HORSE); - caster->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); - caster->setFaction(35); - DoCast(caster, CALL_DARK_RIDER, true); - if (Creature* Dark_Rider = me->FindNearestCreature(28654, 15)) - CAST_AI(npc_dark_rider_of_acherus::npc_dark_rider_of_acherusAI, Dark_Rider->AI())->InitDespawnHorse(caster); + if (charmer->HasAura(EFFECT_STOLEN_HORSE)) + { + charmer->RemoveAurasDueToSpell(EFFECT_STOLEN_HORSE); + caster->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); + caster->setFaction(35); + DoCast(caster, CALL_DARK_RIDER, true); + if (Creature* Dark_Rider = me->FindNearestCreature(28654, 15)) + CAST_AI(npc_dark_rider_of_acherus::npc_dark_rider_of_acherusAI, Dark_Rider->AI())->InitDespawnHorse(caster); + } } } } -- cgit v1.2.3