Skip to content

Commit

Permalink
[c12663] Rework StopMove to not start movement if already stopped
Browse files Browse the repository at this point in the history
thx to Schmoozerd for hint
thx to rsa for pointing to bug

Signed-off-by: Schmoozerd <schmoozerd@cmangos>

(based on commit [12472] - c937eb7)
  • Loading branch information
boxa authored and Dramacydal committed Aug 19, 2013
1 parent bed343e commit 85549c5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/game/Unit.cpp
Expand Up @@ -10844,10 +10844,13 @@ void Unit::SendPetAIReaction()

///----------End of Pet responses methods----------

void Unit::StopMoving()
void Unit::StopMoving(bool forceSendStop /*=false*/)
{
clearUnitState(UNIT_STAT_MOVING);

if (IsStopped() && !forceSendStop)
return;

// not need send any packets if not in world
if (!IsInWorld())
return;
Expand Down
2 changes: 1 addition & 1 deletion src/game/Unit.h
Expand Up @@ -1924,7 +1924,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
MotionMaster* GetMotionMaster() { return &i_motionMaster; }

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 SetConfused(bool apply, ObjectGuid casterGuid = ObjectGuid(), uint32 spellID = 0);
Expand Down
2 changes: 1 addition & 1 deletion src/game/WaypointMovementGenerator.cpp
Expand Up @@ -320,7 +320,7 @@ void FlightPathMovementGenerator::Finalize(Player& player)
// update z position to ground and orientation for landing point
// this prevent cheating with landing point at lags
// when client side flight end early in comparison server side
player.StopMoving();
player.StopMoving(true);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "12662"
#define REVISION_NR "12663"
#endif // __REVISION_NR_H__

0 comments on commit 85549c5

Please sign in to comment.