Fixed crash in HandleSetActiveMoverOpcode.

Removed not needed check and added check isinworld.

--HG--
branch : trunk
This commit is contained in:
n0n4m3
2010-01-13 14:23:25 +03:00
parent 93e6fcfc1b
commit 067de4b5cc

View File

@@ -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());