[9461] Some another cases when movegen can be lost while updating.

This commit is contained in:
VladimirMangos 2010-02-27 01:20:15 +03:00
parent 01e05f5d7e
commit c179c45087
5 changed files with 16 additions and 3 deletions

View file

@ -101,7 +101,8 @@ DestinationHolder<TRAVELLER>::UpdateTraveller(TRAVELLER &traveller, uint32 diff,
if (i_tracker.Passed() || force_update)
{
ResetUpdate();
if (!i_destSet) return true;
if (!i_destSet)
return true;
float x,y,z;
GetLocationNowNoMicroMovement(x, y, z);

View file

@ -375,6 +375,9 @@ bool FleeingMovementGenerator<T>::Update(T &owner, const uint32 & time_diff)
if (i_destinationHolder.UpdateTraveller(traveller, time_diff, false))
{
if (!IsActive(owner)) // force stop processing (movement can move out active zone with cleanup movegens list)
return true; // not expire now, but already lost
i_destinationHolder.ResetUpdate(50);
if(i_nextCheckTime.Passed() && i_destinationHolder.HasArrived())
{

View file

@ -71,7 +71,11 @@ bool PointMovementGenerator<T>::Update(T &unit, const uint32 &diff)
unit.addUnitState(UNIT_STAT_ROAMING_MOVE);
Traveller<T> traveller(unit);
i_destinationHolder.UpdateTraveller(traveller, diff, false);
if (i_destinationHolder.UpdateTraveller(traveller, diff, false))
{
if (!IsActive(unit)) // force stop processing (movement can move out active zone with cleanup movegens list)
return true; // not expire now, but already lost
}
if(i_destinationHolder.HasArrived())
{

View file

@ -177,8 +177,13 @@ bool WaypointMovementGenerator<Creature>::Update(Creature &creature, const uint3
creature.SetUInt32Value(UNIT_NPC_EMOTESTATE, behavior->emote);
if (behavior->spell != 0)
{
creature.CastSpell(&creature, behavior->spell, false);
if (!IsActive(creature)) // force stop processing (cast can change movegens list)
return true; // not expire now, but already lost
}
if (behavior->model1 != 0)
creature.SetDisplayId(behavior->model1);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9460"
#define REVISION_NR "9461"
#endif // __REVISION_NR_H__