diff options
author | silver1ce <none@none> | 2010-01-20 15:05:58 +0200 |
---|---|---|
committer | silver1ce <none@none> | 2010-01-20 15:05:58 +0200 |
commit | 7ce1c094c0af82ff74e2a32d2e911dd81e730d8e (patch) | |
tree | a1df3ed4d8c59c3326a1722f865ea92a82d49676 | |
parent | 6e76e6725353638a79c6f55dcb236e35707ec3f3 (diff) |
Fixes #420 fixed out-of-range group member's position update, which broken after 7014f421c8
--HG--
branch : trunk
-rw-r--r-- | src/game/Player.cpp | 21 | ||||
-rw-r--r-- | src/game/Unit.cpp | 2 | ||||
-rw-r--r-- | src/game/Unit.h | 1 |
3 files changed, 10 insertions, 14 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index b1db9d75107..480a8f26a70 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -5987,22 +5987,17 @@ bool Player::SetPosition(float x, float y, float z, float orientation, bool tele // mover->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TURNING); //AURA_INTERRUPT_FLAG_JUMP not sure - bool move2d = (teleport || GetPositionX() != x || GetPositionY() != y); - - if (move2d || GetPositionZ() != z) - { - // group update - if (move2d && GetGroup()) - SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION); + // group update + if (GetGroup()) + SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION); - // code block for underwater state update - UpdateUnderwaterState(GetMap(), x, y, z); + // code block for underwater state update + UpdateUnderwaterState(GetMap(), x, y, z); - if(GetTrader() && !IsWithinDistInMap(GetTrader(), INTERACTION_DISTANCE)) - GetSession()->SendCancelTrade(); + if(GetTrader() && !IsWithinDistInMap(GetTrader(), INTERACTION_DISTANCE)) + GetSession()->SendCancelTrade(); - CheckExploreSystem(); - } + CheckExploreSystem(); return true; } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index fbd3444bd5d..aa37562df33 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -15943,7 +15943,7 @@ bool Unit::SetPosition(float x, float y, float z, float orientation, bool telepo if ((relocated || turn) && IsVehicle()) GetVehicleKit()->RelocatePassengers(x,y,z,orientation); - return true; + return (relocated || turn); } void Unit::SendThreatListUpdate() diff --git a/src/game/Unit.h b/src/game/Unit.h index f9c0116b256..b1581c6a329 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1426,6 +1426,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject void NearTeleportTo(float x, float y, float z, float orientation, bool casting = false); virtual bool SetPosition(float x, float y, float z, float ang, bool teleport = false); + // returns true if unit's position really changed bool SetPosition(const Position &pos, bool teleport = false) { return SetPosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); } void KnockbackFrom(float x, float y, float speedXY, float speedZ); |