feat(SmartAI): display error on unsupported targets + align TC enums (#1349)
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1548282125491483924');
|
||||||
|
|
||||||
|
-- SMART_TARGET_FARTHEST
|
||||||
|
UPDATE `smart_scripts` SET `target_type` = 28 WHERE `target_type` = 40;
|
||||||
@@ -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_TC_END && e.action.type <= SMART_ACTION_AC_START)
|
||||||
|| e.action.type >= SMART_ACTION_AC_END)
|
|| 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;
|
return false;
|
||||||
}
|
}
|
||||||
switch (e.action.type)
|
switch (e.action.type)
|
||||||
@@ -384,6 +384,17 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
|||||||
default:
|
default:
|
||||||
break;
|
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)
|
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);
|
sLog->outErrorDb("SmartAIMgr: EntryOrGuid %d using event(%u) has invalid phase mask (%u), skipped.", e.entryOrGuid, e.event_id, e.event.event_phase_mask);
|
||||||
|
|||||||
@@ -1216,22 +1216,11 @@ enum SMARTAI_TARGETS
|
|||||||
SMART_TARGET_THREAT_LIST = 24, // All units on creature's threat list, maxdist, playerOnly
|
SMART_TARGET_THREAT_LIST = 24, // All units on creature's threat list, maxdist, playerOnly
|
||||||
SMART_TARGET_CLOSEST_ENEMY = 25, // maxDist, playerOnly
|
SMART_TARGET_CLOSEST_ENEMY = 25, // maxDist, playerOnly
|
||||||
SMART_TARGET_CLOSEST_FRIENDLY = 26, // maxDist, playerOnly
|
SMART_TARGET_CLOSEST_FRIENDLY = 26, // maxDist, playerOnly
|
||||||
// RESERVED = 27,
|
SMART_TARGET_LOOT_RECIPIENTS = 27, // TODO: NOT SUPPORTED YET
|
||||||
// RESERVED = 28,
|
SMART_TARGET_FARTHEST = 28, // maxDist, playerOnly, isInLos
|
||||||
// RESERVED = 29,
|
SMART_TARGET_VEHICLE_PASSENGER = 29, // TODO: NOT SUPPORTED YET
|
||||||
// RESERVED = 30,
|
|
||||||
// RESERVED = 31,
|
|
||||||
// RESERVED = 32,
|
|
||||||
// RESERVED = 33,
|
|
||||||
// RESERVED = 34,
|
|
||||||
// RESERVED = 35,
|
|
||||||
// RESERVED = 36,
|
|
||||||
// RESERVED = 37,
|
|
||||||
// RESERVED = 38,
|
|
||||||
// RESERVED = 39,
|
|
||||||
SMART_TARGET_FARTHEST = 40,
|
|
||||||
|
|
||||||
SMART_TARGET_END = 41
|
SMART_TARGET_END = 30
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SmartTarget
|
struct SmartTarget
|
||||||
|
|||||||
Reference in New Issue
Block a user