feat(SmartAI): display error on unsupported targets + align TC enums (#1349)

This commit is contained in:
Francesco Borzì
2019-01-28 20:23:35 +01:00
committed by GitHub
parent 987095e2c9
commit 2f1c01a1fd
3 changed files with 20 additions and 16 deletions

View File

@@ -357,7 +357,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|| (e.action.type >= SMART_ACTION_TC_END && e.action.type <= SMART_ACTION_AC_START)
|| e.action.type >= SMART_ACTION_AC_END)
{
sLog->outErrorDb("SmartAIMgr: EntryOrGuid %d using event(%u) has invalid action type (%u), skipped.", e.entryOrGuid, e.event_id, e.GetActionType());
sLog->outErrorDb("SmartAIMgr: EntryOrGuid %d using event(%u) has an invalid action type (%u), skipped.", e.entryOrGuid, e.event_id, e.GetActionType());
return false;
}
switch (e.action.type)
@@ -384,6 +384,17 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
default:
break;
}
if (e.target.type < 0 || e.target.type >= SMART_TARGET_END)
{
sLog->outErrorDb("SmartAIMgr: EntryOrGuid %d using event(%u) has an invalid target type (%u), skipped.",
e.entryOrGuid, e.event_id, e.GetTargetType());
return false;
}
if (e.target.type == SMART_TARGET_LOOT_RECIPIENTS || e.target.type == SMART_TARGET_VEHICLE_PASSENGER) {
sLog->outErrorDb("SmartAIMgr: EntryOrGuid %d using event(%u) has a target type that is not yet supported on AzerothCore (%u), skipped.",
e.entryOrGuid, e.event_id, e.GetTargetType());
return false;
}
if (e.event.event_phase_mask > SMART_EVENT_PHASE_ALL)
{
sLog->outErrorDb("SmartAIMgr: EntryOrGuid %d using event(%u) has invalid phase mask (%u), skipped.", e.entryOrGuid, e.event_id, e.event.event_phase_mask);