aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortreeston <treeston.mmoc@gmail.com>2017-06-06 22:16:14 +0200
committerCarbenium <carbenium@outlook.com>2020-07-16 21:47:27 +0200
commite6145a8ec4aee285a9f9da4d252d832b5e73fff0 (patch)
tree0b2dcab01562ed3e64920817e6fe7699589ff6f9
parent323e3b9cdeda96d5f0d5be1c615de489ee41ad85 (diff)
Fix a whole set of possible infinite loop crashes in SAI (events triggering themselves even with cooldown set).
(cherry picked from commit 823007934a2bd084a4e6e607da9369fbea16c99d)
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index 35e93d57c91..54d5b5f7fb4 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -2963,8 +2963,8 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
case SMART_EVENT_RECEIVE_EMOTE:
if (e.event.emote.emote == var0)
{
- ProcessAction(e, unit);
RecalcTimer(e, e.event.emote.cooldownMin, e.event.emote.cooldownMax);
+ ProcessAction(e, unit);
}
break;
case SMART_EVENT_KILL:
@@ -2975,8 +2975,8 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
return;
if (e.event.kill.creature && unit->GetEntry() != e.event.kill.creature)
return;
- ProcessAction(e, unit);
RecalcTimer(e, e.event.kill.cooldownMin, e.event.kill.cooldownMax);
+ ProcessAction(e, unit);
break;
}
case SMART_EVENT_SPELLHIT_TARGET:
@@ -2987,8 +2987,8 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
if ((!e.event.spellHit.spell || spell->Id == e.event.spellHit.spell) &&
(!e.event.spellHit.school || (spell->SchoolMask & e.event.spellHit.school)))
{
- ProcessAction(e, unit, 0, 0, bvar, spell);
RecalcTimer(e, e.event.spellHit.cooldownMin, e.event.spellHit.cooldownMax);
+ ProcessAction(e, unit, 0, 0, bvar, spell);
}
break;
}
@@ -3006,8 +3006,8 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
if ((e.event.los.noHostile && !me->IsHostileTo(unit)) ||
(!e.event.los.noHostile && me->IsHostileTo(unit)))
{
- ProcessAction(e, unit);
RecalcTimer(e, e.event.los.cooldownMin, e.event.los.cooldownMax);
+ ProcessAction(e, unit);
}
}
break;
@@ -3026,8 +3026,8 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
if ((e.event.los.noHostile && !me->IsHostileTo(unit)) ||
(!e.event.los.noHostile && me->IsHostileTo(unit)))
{
- ProcessAction(e, unit);
RecalcTimer(e, e.event.los.cooldownMin, e.event.los.cooldownMax);
+ ProcessAction(e, unit);
}
}
break;
@@ -3049,8 +3049,8 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
return;
if (e.event.summoned.creature && unit->GetEntry() != e.event.summoned.creature)
return;
- ProcessAction(e, unit);
RecalcTimer(e, e.event.summoned.cooldownMin, e.event.summoned.cooldownMax);
+ ProcessAction(e, unit);
break;
}
case SMART_EVENT_RECEIVE_HEAL:
@@ -3059,8 +3059,8 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
{
if (var0 > e.event.minMaxRepeat.max || var0 < e.event.minMaxRepeat.min)
return;
- ProcessAction(e, unit);
RecalcTimer(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax);
+ ProcessAction(e, unit);
break;
}
case SMART_EVENT_MOVEMENTINFORM:
@@ -3093,16 +3093,16 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
{
if (e.event.summoned.creature && e.event.summoned.creature != var0)
return;
- ProcessAction(e, unit, var0);
RecalcTimer(e, e.event.summoned.cooldownMin, e.event.summoned.cooldownMax);
+ ProcessAction(e, unit, var0);
break;
}
case SMART_EVENT_INSTANCE_PLAYER_ENTER:
{
if (e.event.instancePlayerEnter.team && var0 != e.event.instancePlayerEnter.team)
return;
- ProcessAction(e, unit, var0);
RecalcTimer(e, e.event.instancePlayerEnter.cooldownMin, e.event.instancePlayerEnter.cooldownMax);
+ ProcessAction(e, unit, var0);
break;
}
case SMART_EVENT_ACCEPTED_QUEST:
@@ -3138,8 +3138,8 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
{
if (e.event.dataSet.id != var0 || e.event.dataSet.value != var1)
return;
- ProcessAction(e, unit, var0, var1);
RecalcTimer(e, e.event.dataSet.cooldownMin, e.event.dataSet.cooldownMax);
+ ProcessAction(e, unit, var0, var1);
break;
}
case SMART_EVENT_PASSENGER_REMOVED:
@@ -3147,8 +3147,8 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
{
if (!unit)
return;
- ProcessAction(e, unit);
RecalcTimer(e, e.event.minMax.repeatMin, e.event.minMax.repeatMax);
+ ProcessAction(e, unit);
break;
}
case SMART_EVENT_TIMED_EVENT_TRIGGERED: