From da6ea9759c4ea3be508ba3927c7a9264ba82ad5b Mon Sep 17 00:00:00 2001 From: hondacrx Date: Thu, 28 Apr 2022 10:16:23 -0400 Subject: [PATCH] Core/SAI: Do not allow SMART_EVENT_RESET to call SMART_ACTION_CALL_SCRIPT_RESET Port From (https://github.com/TrinityCore/TrinityCore/commit/ae6f8bc4f546b0db9b39acad03687d968a348779) --- Source/Game/AI/SmartScripts/SmartAIManager.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/Game/AI/SmartScripts/SmartAIManager.cs b/Source/Game/AI/SmartScripts/SmartAIManager.cs index 6309191e2..e49a5947b 100644 --- a/Source/Game/AI/SmartScripts/SmartAIManager.cs +++ b/Source/Game/AI/SmartScripts/SmartAIManager.cs @@ -893,6 +893,14 @@ namespace Game.AI return false; } break; + case SmartEvents.Reset: + if (e.Action.type == SmartActions.CallScriptReset) + { + // There might be SMART_TARGET_* cases where this should be allowed, they will be handled if needed + Log.outError(LogFilter.Sql, $"SmartAIMgr: {e} uses event SMART_EVENT_RESET and action SMART_ACTION_CALL_SCRIPT_RESET, skipped."); + return false; + } + break; case SmartEvents.QuestObjCompletion: if (Global.ObjectMgr.GetQuestObjective(e.Event.questObjective.id) == null) { @@ -921,7 +929,6 @@ namespace Game.AI case SmartEvents.Death: case SmartEvents.Evade: case SmartEvents.ReachedHome: - case SmartEvents.Reset: case SmartEvents.JustSummoned: case SmartEvents.WaypointStart: case SmartEvents.WaypointReached: