AI/SmartScripts: Warn on startup for ACTION_INVOKER_CAST without invoker (same as invoker targets)

Port From (https://github.com/TrinityCore/TrinityCore/commit/a2d266edf3da950ac4aeaf48b6778f8bbc7bcdd4)
This commit is contained in:
hondacrx
2021-10-17 17:02:08 -04:00
parent 78421960db
commit 9a41de7593
+10 -2
View File
@@ -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;