From 5d8b77b440be8888fbfe2e6693f86aa1ea263e86 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Fri, 18 Feb 2022 13:23:08 -0500 Subject: [PATCH] Game/SmartScripts: Reset counter in SAI only on Initialize. Port From (https://github.com/TrinityCore/TrinityCore/commit/864ce5a11cab0e6b62e74eea958b02452e6c8797) --- Source/Game/AI/SmartScripts/SmartScript.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Source/Game/AI/SmartScripts/SmartScript.cs b/Source/Game/AI/SmartScripts/SmartScript.cs index 24946dcfa..05e5ac126 100644 --- a/Source/Game/AI/SmartScripts/SmartScript.cs +++ b/Source/Game/AI/SmartScripts/SmartScript.cs @@ -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)