diff --git a/src/game/Player.cpp b/src/game/Player.cpp index b1db9d7510..480a8f26a7 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); + // group update + if (GetGroup()) + SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION); - if (move2d || GetPositionZ() != z) - { - // group update - if (move2d && 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 fbd3444bd5..aa37562df3 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 f9c0116b25..b1581c6a32 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);