[12674] Rework StopMove to not start movement if already stopped

thx to Schmoozerd for hint
thx to rsa for pointing to bug

Signed-off-by: Schmoozerd <schmoozerd@cmangos>
This commit is contained in:
boxa 2013-08-19 16:30:01 +03:00 committed by Antz
parent de2cc58be9
commit 394be2c5bf
4 changed files with 7 additions and 4 deletions

View file

@ -10852,10 +10852,13 @@ void Unit::SendPetAIReaction()
///----------End of Pet responses methods---------- ///----------End of Pet responses methods----------
void Unit::StopMoving() void Unit::StopMoving(bool forceSendStop /*=false*/)
{ {
clearUnitState(UNIT_STAT_MOVING); clearUnitState(UNIT_STAT_MOVING);
if (IsStopped() && !forceSendStop)
return;
// not need send any packets if not in world // not need send any packets if not in world
if (!IsInWorld()) if (!IsInWorld())
return; return;

View file

@ -2675,7 +2675,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
MotionMaster* GetMotionMaster() { return &i_motionMaster; } MotionMaster* GetMotionMaster() { return &i_motionMaster; }
bool IsStopped() const { return !(hasUnitState(UNIT_STAT_MOVING)); } bool IsStopped() const { return !(hasUnitState(UNIT_STAT_MOVING)); }
void StopMoving(); void StopMoving(bool forceSendStop = false);
void SetFeared(bool apply, ObjectGuid casterGuid = ObjectGuid(), uint32 spellID = 0, uint32 time = 0); void SetFeared(bool apply, ObjectGuid casterGuid = ObjectGuid(), uint32 spellID = 0, uint32 time = 0);
void SetConfused(bool apply, ObjectGuid casterGuid = ObjectGuid(), uint32 spellID = 0); void SetConfused(bool apply, ObjectGuid casterGuid = ObjectGuid(), uint32 spellID = 0);

View file

@ -320,7 +320,7 @@ void FlightPathMovementGenerator::Finalize(Player& player)
// update z position to ground and orientation for landing point // update z position to ground and orientation for landing point
// this prevent cheating with landing point at lags // this prevent cheating with landing point at lags
// when client side flight end early in comparison server side // when client side flight end early in comparison server side
player.StopMoving(); player.StopMoving(true);
} }
} }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "12673" #define REVISION_NR "12674"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__