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

This commit is contained in:
Treeston
2018-08-06 12:04:18 +02:00
parent 5cdb53896f
commit a3c85c8a2b

View File

@@ -517,7 +517,7 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e)
case SMART_TARGET_INVOKER_PARTY:
if (e.GetScriptType() != SMART_SCRIPT_TYPE_TIMED_ACTIONLIST && e.GetEventType() != SMART_EVENT_LINK && !EventHasInvoker(e.event.type))
{
TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u has invoker target, but action does not provide any invoker!", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType());
TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u has invoker target, but event does not provide any invoker!", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType());
// allow this to load for now
// return false;
}
@@ -1182,8 +1182,15 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
return false;
break;
}
case SMART_ACTION_ADD_AURA:
case SMART_ACTION_INVOKER_CAST:
if (e.GetScriptType() != SMART_SCRIPT_TYPE_TIMED_ACTIONLIST && e.GetEventType() != SMART_EVENT_LINK && !EventHasInvoker(e.event.type))
{
TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u has invoker cast action, but event does not provide any invoker!", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType());
// allow this to load for now
// return false;
}
// no break
case SMART_ACTION_ADD_AURA:
if (!IsSpellValid(e, e.action.cast.spell))
return false;
break;