diff options
| author | silver1ce <none@none> | 2010-01-18 21:51:45 +0200 |
|---|---|---|
| committer | silver1ce <none@none> | 2010-01-18 21:51:45 +0200 |
| commit | cfca61b176f1e262e71fa3ba2372ddd631d36c58 (patch) | |
| tree | 3d948de297d9268adadfc49af40a0646bb04cb28 /src/game/Player.cpp | |
| parent | f920a3c57b716712a4eaf2530aae8b6005dc3cfb (diff) | |
Auras with turn/move interrupt flags are now removed for creatures when they turn/move, cleanup
--HG--
branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
| -rw-r--r-- | src/game/Player.cpp | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 4bbd4fbbac7..b1db9d75107 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -5978,12 +5978,8 @@ void Player::removeActionButton(uint8 button) bool Player::SetPosition(float x, float y, float z, float orientation, bool teleport) { - // prevent crash when a bad coord is sent by the client - if (!Trinity::IsValidMapCoord(x,y,z,orientation)) - { - sLog.outDebug("Player::SetPosition(%f, %f, %f, %f, %d) .. bad coordinates for player %d!",x,y,z,orientation,teleport,GetGUIDLow()); + if (!Unit::SetPosition(x, y, z, orientation, teleport)) return false; - } //if(movementInfo.flags & MOVEMENTFLAG_MOVING) // mover->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_MOVE); @@ -5991,22 +5987,10 @@ 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 turn = (GetOrientation() != orientation); bool move2d = (teleport || GetPositionX() != x || GetPositionY() != y); - if (turn) - RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TURNING); - if (move2d || GetPositionZ() != z) { - RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_MOVE); - - // move and update visible state if need - GetMap()->PlayerRelocation(this, x, y, z, orientation); - - // reread after Map::Relocation - GetPosition(x, y, z); - // group update if (move2d && GetGroup()) SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION); @@ -6014,13 +5998,11 @@ bool Player::SetPosition(float x, float y, float z, float orientation, bool tele // code block for underwater state update UpdateUnderwaterState(GetMap(), x, y, z); - if(GetTrader() && !IsWithinDistInMap(GetTrader(), 5)) + if(GetTrader() && !IsWithinDistInMap(GetTrader(), INTERACTION_DISTANCE)) GetSession()->SendCancelTrade(); CheckExploreSystem(); } - else if(turn) - SetOrientation(orientation); return true; } |
