diff options
author | megamage <none@none> | 2009-05-31 23:15:06 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-05-31 23:15:06 -0500 |
commit | 43d12d1303078e37e3e40ca1b1cbd343087cd32b (patch) | |
tree | e4203b91efa1093cec85a60fc4c85f3d1833f5de | |
parent | d83658c82107247f884cd136d752bd3ef86b3cbc (diff) |
*Fix a crash caused by possessed creatures. Thanks to Amit86
--HG--
branch : trunk
-rw-r--r-- | src/game/MovementHandler.cpp | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp index 2fa6adf5a13..072236af931 100644 --- a/src/game/MovementHandler.cpp +++ b/src/game/MovementHandler.cpp @@ -278,16 +278,6 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data ) movementInfo.t_seat = -1; } - // fall damage generation (ignore in flight case that can be triggered also at lags in moment teleportation to another map). - if (opcode == MSG_MOVE_FALL_LAND && plMover && !plMover->isInFlight()) - plMover->HandleFall(movementInfo); - - if (plMover && ((movementInfo.flags & MOVEMENTFLAG_SWIMMING) != 0) != plMover->IsInWater()) - { - // now client not include swimming flag in case jumping under water - plMover->SetInWater( !plMover->IsInWater() || plMover->GetBaseMap()->IsUnderWater(movementInfo.x, movementInfo.y, movementInfo.z) ); - } - /*----------------------*/ /* process position-change */ @@ -341,11 +331,18 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data ) } else // creature charmed { - if(Map *map = mover->GetMap()) - { - map->CreatureRelocation((Creature*)mover, movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o); - } - mover->SetUnitMovementFlags(movementInfo.flags); + mover->GetMap()->CreatureRelocation((Creature*)mover, movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o); + } + + // Aura removal may remove mover + // fall damage generation (ignore in flight case that can be triggered also at lags in moment teleportation to another map). + if (opcode == MSG_MOVE_FALL_LAND && plMover && !plMover->isInFlight()) + plMover->HandleFall(movementInfo); + + if (plMover && ((movementInfo.flags & MOVEMENTFLAG_SWIMMING) != 0) != plMover->IsInWater()) + { + // now client not include swimming flag in case jumping under water + plMover->SetInWater( !plMover->IsInWater() || plMover->GetBaseMap()->IsUnderWater(movementInfo.x, movementInfo.y, movementInfo.z) ); } } |