mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 09:44:45 +01:00
Fix a whole set of possible infinite loop crashes in SAI (events triggering themselves even with cooldown set).
This commit is contained in:
@@ -2705,8 +2705,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:
|
||||
@@ -2717,8 +2717,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:
|
||||
@@ -2729,8 +2729,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;
|
||||
}
|
||||
@@ -2748,8 +2748,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;
|
||||
@@ -2768,8 +2768,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;
|
||||
@@ -2791,8 +2791,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:
|
||||
@@ -2801,8 +2801,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:
|
||||
@@ -2835,16 +2835,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:
|
||||
@@ -2880,8 +2880,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:
|
||||
@@ -2889,8 +2889,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:
|
||||
|
||||
Reference in New Issue
Block a user