[11336] Use movgen Finilize for code applied at normal movegen expire

This let resolve porblems for casts/etc that before happens
before real movgen stop from code logic.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Schmoozerd 2011-04-12 15:28:37 +04:00 committed by VladimirMangos
parent ea516bef45
commit 328bd68350
5 changed files with 28 additions and 26 deletions

View file

@ -44,6 +44,9 @@ template<class T>
void PointMovementGenerator<T>::Finalize(T &unit)
{
unit.clearUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE);
if (i_destinationHolder.HasArrived())
MovementInform(unit);
}
template<class T>
@ -82,16 +85,8 @@ bool PointMovementGenerator<T>::Update(T &unit, const uint32 &diff)
return true; // not expire now, but already lost
}
if(i_destinationHolder.HasArrived())
{
unit.clearUnitState(UNIT_STAT_ROAMING_MOVE);
MovementInform(unit);
if (!IsActive(unit))
return true;
if (i_destinationHolder.HasArrived())
return false;
}
return true;
}