feat(Core/SmartScripts): SMART_ACTION_SET_MOVEMENT_SPEED (#10018)

This commit is contained in:
IntelligentQuantum
2022-01-05 20:40:19 +03:30
committed by GitHub
parent 5f9235a62d
commit 2bc373b4f6
3 changed files with 46 additions and 0 deletions

View File

@@ -1182,6 +1182,21 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
}
break;
}
case SMART_ACTION_SET_MOVEMENT_SPEED:
{
if (e.action.movementSpeed.movementType >= MAX_MOVE_TYPE)
{
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %u SourceType %u Event %u Action %u uses invalid movementType %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.movementSpeed.movementType);
return false;
}
if (!e.action.movementSpeed.speedInteger && !e.action.movementSpeed.speedFraction)
{
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %u SourceType %u Event %u Action %u uses speed 0, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
return false;
}
break;
}
case SMART_ACTION_START_CLOSEST_WAYPOINT:
case SMART_ACTION_FOLLOW:
case SMART_ACTION_SET_ORIENTATION: