Core/Movement: use helpers for validation

Port From (https://github.com/TrinityCore/TrinityCore/commit/0b6049fe0bf49a8c21114960cb7a6522f48c8308)
This commit is contained in:
hondacrx
2021-09-26 13:49:13 -04:00
parent 53ad19d2f9
commit cf79d69487
3 changed files with 9 additions and 7 deletions
@@ -19,6 +19,7 @@ using Framework.Constants;
using Framework.Database;
using Game.DataStorage;
using Game.Entities;
using Game.Movement;
using Game.Spells;
using System;
using System.Collections.Generic;
@@ -717,7 +718,7 @@ namespace Game.AI
}
case SmartEvents.Movementinform:
{
if (e.Event.movementInform.type >= (uint)MovementGeneratorType.Max)
if (MotionMaster.IsInvalidMovementGeneratorType((MovementGeneratorType)e.Event.movementInform.type))
{
Log.outError(LogFilter.ScriptsAi, "SmartAIMgr: Entry {0} SourceType {1} Event {2} Action {3} uses invalid Motion type {4}, skipped.", e.EntryOrGuid, e.GetScriptType(), e.EventId, e.GetActionType(), e.Event.movementInform.type);
return false;