Core/SAI: Implement new action to set movement speed

This commit is contained in:
Lopfest
2018-01-30 11:31:52 +01:00
committed by Shauren
parent 04ab611111
commit 5dd6d31c01
3 changed files with 43 additions and 2 deletions
@@ -1492,6 +1492,22 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
}
break;
}
case SMART_ACTION_SET_MOVEMENT_SPEED:
{
if (e.action.movementSpeed.movementType >= MAX_MOVE_TYPE)
{
TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry " SI64FMTD " 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)
{
TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry " SI64FMTD " 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: