diff --git a/Client/mods/deathmatch/logic/CPacketHandler.cpp b/Client/mods/deathmatch/logic/CPacketHandler.cpp index b8fa33e9d23..012fecf66e0 100644 --- a/Client/mods/deathmatch/logic/CPacketHandler.cpp +++ b/Client/mods/deathmatch/logic/CPacketHandler.cpp @@ -3219,18 +3219,10 @@ void CPacketHandler::Packet_EntityAdd(NetBitStreamInterface& bitStream) SRotationDegreesSync rotationDegrees(false); bitStream.Read(&rotationDegrees); - // Read out the vehicle value as a char, then convert - unsigned char ucModel = 0xFF; - bitStream.Read(ucModel); - - // The server appears to subtract 400 from the vehicle id before - // sending it to us, as to allow the value to fit into an unsigned - // char. - // - // Too bad this was never documented. - // - // --slush - unsigned short usModel = ucModel + 400; + // Read out the vehicle model + std::uint16_t usModel = 0xFFFF; + bitStream.Read(usModel); + if (!CClientVehicleManager::IsValidModel(usModel)) { RaiseEntityAddError(39); diff --git a/Server/mods/deathmatch/logic/packets/CEntityAddPacket.cpp b/Server/mods/deathmatch/logic/packets/CEntityAddPacket.cpp index 3dea9859278..835fcbb20d8 100644 --- a/Server/mods/deathmatch/logic/packets/CEntityAddPacket.cpp +++ b/Server/mods/deathmatch/logic/packets/CEntityAddPacket.cpp @@ -447,12 +447,7 @@ bool CEntityAddPacket::Write(NetBitStreamInterface& BitStream) const BitStream.Write(&position); BitStream.Write(&rotationDegrees); - // Vehicle id as a char - // I'm assuming the "-400" is for adjustment so that all car values can - // fit into a char? Why doesn't someone document this? - // - // --slush - BitStream.Write(static_cast(pVehicle->GetModel() - 400)); + BitStream.Write(static_cast(pVehicle->GetModel())); // Health SVehicleHealthSync health;