From 067de4b5ccd9fcfe48279eb0792f54ef4ffd3474 Mon Sep 17 00:00:00 2001 From: n0n4m3 Date: Wed, 13 Jan 2010 14:23:25 +0300 Subject: Fixed crash in HandleSetActiveMoverOpcode. Removed not needed check and added check isinworld. --HG-- branch : trunk --- src/game/MovementHandler.cpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'src/game') 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()); -- cgit v1.2.3