From 9a41de7593e3be4c8304f074486851e19db524e8 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sun, 17 Oct 2021 17:02:08 -0400 Subject: [PATCH] AI/SmartScripts: Warn on startup for ACTION_INVOKER_CAST without invoker (same as invoker targets) Port From (https://github.com/TrinityCore/TrinityCore/commit/a2d266edf3da950ac4aeaf48b6778f8bbc7bcdd4) --- Source/Game/AI/SmartScripts/SmartAIManager.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Source/Game/AI/SmartScripts/SmartAIManager.cs b/Source/Game/AI/SmartScripts/SmartAIManager.cs index ea1a7611c..5cd8be585 100644 --- a/Source/Game/AI/SmartScripts/SmartAIManager.cs +++ b/Source/Game/AI/SmartScripts/SmartAIManager.cs @@ -490,7 +490,7 @@ namespace Game.AI case SmartTargets.InvokerParty: if (e.GetScriptType() != SmartScriptType.TimedActionlist && e.GetEventType() != SmartEvents.Link && !EventHasInvoker(e.Event.type)) { - Log.outError(LogFilter.Sql, $"SmartAIMgr: Entry {e.EntryOrGuid} SourceType {e.GetScriptType()} Event {e.GetEventType()} Action {e.GetActionType()} has invoker target, but action does not provide any invoker!"); + Log.outError(LogFilter.Sql, $"SmartAIMgr: Entry {e.EntryOrGuid} SourceType {e.GetScriptType()} Event {e.GetEventType()} Action {e.GetActionType()} has invoker target, but event does not provide any invoker!"); // allow this to load for now // return false; } @@ -1064,8 +1064,16 @@ namespace Game.AI return false; break; } - case SmartActions.AddAura: case SmartActions.InvokerCast: + if (e.GetScriptType() != SmartScriptType.TimedActionlist && e.GetEventType() != SmartEvents.Link && !EventHasInvoker(e.Event.type)) + { + Log.outError(LogFilter.Sql, $"SmartAIMgr: {e} has invoker cast action, but event does not provide any invoker!"); + // allow this to load for now + // return false; + } + // no break + goto case SmartActions.AddAura; + case SmartActions.AddAura: if (!IsSpellValid(e, e.Action.cast.spell)) return false; break;