mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-18 14:10:18 -04:00
Handle deprecated SAI actions and events (#26846)
* Core/SAI: Show a clear error for no longer supported SAI actions
* Core/SAI: Show a warning for deprecated SAI events, still loading them.
Disable log "sql.sql.deprecation" in config if you want to ignore the warning
(cherry picked from commit 3af4d17188)
This commit is contained in:
@@ -1547,6 +1547,19 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
TC_LOG_ERROR("sql.sql", "SmartAIMgr: Not handled event_type(%u), Entry " SI64FMTD " SourceType %u Event %u Action %u, skipped.", e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Additional check for deprecated
|
||||
switch (e.GetEventType())
|
||||
{
|
||||
// Deprecated
|
||||
case SMART_EVENT_FRIENDLY_HEALTH:
|
||||
case SMART_EVENT_TARGET_HEALTH_PCT:
|
||||
case SMART_EVENT_IS_BEHIND_TARGET:
|
||||
TC_LOG_WARN("sql.sql.deprecation", "SmartAIMgr: Deprecated event_type(%u), Entry " SI64FMTD " SourceType %u Event %u Action %u, it might be removed in the future, loaded for now.", e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!CheckUnusedEventParams(e))
|
||||
@@ -2379,6 +2392,11 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
}
|
||||
break;
|
||||
}
|
||||
// No longer supported
|
||||
case SMART_ACTION_INSTALL_AI_TEMPLATE:
|
||||
case SMART_ACTION_SET_DYNAMIC_FLAG:
|
||||
TC_LOG_ERROR("sql.sql.nolongersupported", "SmartAIMgr: No longer supported action_type(%u), event_type(%u), Entry " SI64FMTD " SourceType %u Event %u, skipped.", e.GetActionType(), e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id);
|
||||
return false;
|
||||
default:
|
||||
TC_LOG_ERROR("sql.sql", "SmartAIMgr: Not handled action_type(%u), event_type(%u), Entry " SI64FMTD " SourceType %u Event %u, skipped.", e.GetActionType(), e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user