Game/SmartScripts: Reset counter in SAI only on Initialize.

Port From (https://github.com/TrinityCore/TrinityCore/commit/864ce5a11cab0e6b62e74eea958b02452e6c8797)
This commit is contained in:
hondacrx
2022-02-18 13:23:08 -05:00
parent 01b1b4f296
commit 5d8b77b440
@@ -4061,6 +4061,7 @@ namespace Game.AI
ProcessEventsFor(SmartEvents.AiInit);
InstallEvents();
ProcessEventsFor(SmartEvents.JustCreated);
_counterList.Clear();
}
public void OnInitialize(AreaTriggerRecord at)
@@ -4082,7 +4083,10 @@ namespace Game.AI
foreach (var holder in _events)
InitTimer(holder);//calculate timers for first time use
ProcessEventsFor(SmartEvents.AiInit);
InstallEvents();
ProcessEventsFor(SmartEvents.JustCreated);
_counterList.Clear();
}
public void OnInitialize(SceneTemplate scene)
@@ -4104,7 +4108,10 @@ namespace Game.AI
foreach (var holder in _events)
InitTimer(holder);//calculate timers for first time use
ProcessEventsFor(SmartEvents.AiInit);
InstallEvents();
ProcessEventsFor(SmartEvents.JustCreated);
_counterList.Clear();
}
public void OnInitialize(Quest qst)
@@ -4126,7 +4133,10 @@ namespace Game.AI
foreach (var holder in _events)
InitTimer(holder);//calculate timers for first time use
ProcessEventsFor(SmartEvents.AiInit);
InstallEvents();
ProcessEventsFor(SmartEvents.JustCreated);
_counterList.Clear();
}
public void OnMoveInLineOfSight(Unit who)