aboutsummaryrefslogtreecommitdiff
path: root/src/game/MovementHandler.cpp
diff options
context:
space:
mode:
authorn0n4m3 <none@none>2010-01-13 14:23:25 +0300
committern0n4m3 <none@none>2010-01-13 14:23:25 +0300
commit067de4b5ccd9fcfe48279eb0792f54ef4ffd3474 (patch)
tree5b0911b232ea7fd9f7ce0b978055190f3df8ab28 /src/game/MovementHandler.cpp
parent93e6fcfc1be367206c4a85c4c233d763481eacd3 (diff)
Fixed crash in HandleSetActiveMoverOpcode.
Removed not needed check and added check isinworld. --HG-- branch : trunk
Diffstat (limited to 'src/game/MovementHandler.cpp')
-rw-r--r--src/game/MovementHandler.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp
index e675352f198..d4388f3c7a4 100644
--- a/src/game/MovementHandler.cpp
+++ b/src/game/MovementHandler.cpp
@@ -488,20 +488,18 @@ void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recv_data)
uint64 guid;
recv_data >> guid;
- if(guid == GetPlayer()->m_mover->GetGUID())
- return;
-
- if(Unit *mover = ObjectAccessor::GetUnit(*GetPlayer(), guid))
- {
- GetPlayer()->SetMover(mover);
- if(mover != GetPlayer() && mover->canFly())
- {
- WorldPacket data(SMSG_MOVE_SET_CAN_FLY, 12);
- data.append(mover->GetPackGUID());
- data << uint32(0);
- SendPacket(&data);
- }
- }
+ if(GetPlayer()->IsInWorld())
+ if(Unit *mover = ObjectAccessor::GetUnit(*GetPlayer(), guid))
+ {
+ GetPlayer()->SetMover(mover);
+ if(mover != GetPlayer() && mover->canFly())
+ {
+ WorldPacket data(SMSG_MOVE_SET_CAN_FLY, 12);
+ data.append(mover->GetPackGUID());
+ data << uint32(0);
+ SendPacket(&data);
+ }
+ }
else
{
sLog.outError("HandleSetActiveMoverOpcode: incorrect mover guid: mover is " UI64FMTD " and should be " UI64FMTD, guid, _player->m_mover->GetGUID());