mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-26 20:02:25 +01:00
* Update structure for SMSG_ADDON_INFO and add some sort of basic handling for incorrect addon CRCs (anti-cheating).
* Fix CRLF in MovementHandler.cpp. * Move some handlers/senders to correct place. --HG-- branch : trunk
This commit is contained in:
@@ -608,17 +608,49 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data)
|
||||
int8 seatId;
|
||||
recv_data >> seatId;
|
||||
|
||||
if(!accessory)
|
||||
GetPlayer()->ChangeSeat(-1, seatId > 0); // prev/next
|
||||
else if(Unit *vehUnit = ObjectAccessor::GetUnit(*GetPlayer(), accessory))
|
||||
if(Vehicle *vehicle = vehUnit->GetVehicleKit())
|
||||
if(vehicle->HasEmptySeat(seatId))
|
||||
if(!accessory)
|
||||
GetPlayer()->ChangeSeat(-1, seatId > 0); // prev/next
|
||||
else if(Unit *vehUnit = ObjectAccessor::GetUnit(*GetPlayer(), accessory))
|
||||
if(Vehicle *vehicle = vehUnit->GetVehicleKit())
|
||||
if(vehicle->HasEmptySeat(seatId))
|
||||
GetPlayer()->EnterVehicle(vehicle, seatId);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSession::HandleEnterPlayerVehicle(WorldPacket &data)
|
||||
{
|
||||
// Read guid
|
||||
uint64 guid;
|
||||
data >> guid;
|
||||
|
||||
if(Player* pl=ObjectAccessor::FindPlayer(guid))
|
||||
{
|
||||
if (!pl->GetVehicleKit())
|
||||
return;
|
||||
if (!pl->IsInRaidWith(_player))
|
||||
return;
|
||||
if(!pl->IsWithinDistInMap(_player,INTERACTION_DISTANCE))
|
||||
return;
|
||||
_player->EnterVehicle(pl);
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSession::HandleEjectPasenger(WorldPacket &data)
|
||||
{
|
||||
if(data.GetOpcode()==CMSG_EJECT_PASSENGER)
|
||||
{
|
||||
if(Vehicle* Vv= _player->GetVehicleKit())
|
||||
{
|
||||
uint64 guid;
|
||||
data >> guid;
|
||||
if(Player* Pl=ObjectAccessor::FindPlayer(guid))
|
||||
Pl->ExitVehicle();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSession::HandleRequestVehicleExit(WorldPacket &recv_data)
|
||||
{
|
||||
sLog.outDebug("WORLD: Recvd CMSG_REQUEST_VEHICLE_EXIT");
|
||||
|
||||
Reference in New Issue
Block a user