File tree Expand file tree Collapse file tree 2 files changed +5
-18
lines changed
Client/mods/deathmatch/logic
Server/mods/deathmatch/logic/packets Expand file tree Collapse file tree 2 files changed +5
-18
lines changed Original file line number Diff line number Diff line change @@ -3219,18 +3219,10 @@ void CPacketHandler::Packet_EntityAdd(NetBitStreamInterface& bitStream)
3219
3219
SRotationDegreesSync rotationDegrees (false );
3220
3220
bitStream.Read (&rotationDegrees);
3221
3221
3222
- // Read out the vehicle value as a char, then convert
3223
- unsigned char ucModel = 0xFF ;
3224
- bitStream.Read (ucModel);
3225
-
3226
- // The server appears to subtract 400 from the vehicle id before
3227
- // sending it to us, as to allow the value to fit into an unsigned
3228
- // char.
3229
- //
3230
- // Too bad this was never documented.
3231
- //
3232
- // --slush
3233
- unsigned short usModel = ucModel + 400 ;
3222
+ // Read out the vehicle model
3223
+ std::uint16_t usModel = 0xFFFF ;
3224
+ bitStream.Read (usModel);
3225
+
3234
3226
if (!CClientVehicleManager::IsValidModel (usModel))
3235
3227
{
3236
3228
RaiseEntityAddError (39 );
Original file line number Diff line number Diff line change @@ -447,12 +447,7 @@ bool CEntityAddPacket::Write(NetBitStreamInterface& BitStream) const
447
447
BitStream.Write (&position);
448
448
BitStream.Write (&rotationDegrees);
449
449
450
- // Vehicle id as a char
451
- // I'm assuming the "-400" is for adjustment so that all car values can
452
- // fit into a char? Why doesn't someone document this?
453
- //
454
- // --slush
455
- BitStream.Write (static_cast <unsigned char >(pVehicle->GetModel () - 400 ));
450
+ BitStream.Write (static_cast <std::uint16_t >(pVehicle->GetModel ()));
456
451
457
452
// Health
458
453
SVehicleHealthSync health;
You can’t perform that action at this time.
0 commit comments