mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 13:37:00 +00:00
[9434] Prevent crash at script call that modify movegen list at MovementInform call.
This commit is contained in:
parent
244d25189c
commit
f47f5a1deb
3 changed files with 14 additions and 3 deletions
|
|
@ -206,6 +206,17 @@ bool WaypointMovementGenerator<Creature>::Update(Creature &creature, const uint3
|
|||
|
||||
i_hasDone[idx] = true;
|
||||
MovementInform(creature);
|
||||
|
||||
// force stop processing (script change movegen list)
|
||||
if (creature.GetMotionMaster()->empty() || creature.GetMotionMaster()->top() != this)
|
||||
return true; // not expire now, but already lost
|
||||
|
||||
// prevent a crash at empty waypoint path.
|
||||
if (!i_path || i_path->empty())
|
||||
{
|
||||
creature.clearUnitState(UNIT_STAT_ROAMING_MOVE);
|
||||
return true;
|
||||
}
|
||||
} // HasDone == false
|
||||
} // i_creature.IsStopped()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue