Skip to content

Commit 47bc53f

Browse files
committed
Remove outdated bitstream checks
1 parent d302d3c commit 47bc53f

19 files changed

+326
-631
lines changed

Client/mods/deathmatch/logic/CClientGame.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,12 +1819,10 @@ void CClientGame::UpdatePlayerWeapons()
18191819
SWeaponSlotSync slot;
18201820

18211821
// Always send bit in case server is not in sync
1822-
if ((BitStream.Version() >= 0x44 && m_lastWeaponSlot == WEAPONSLOT_TYPE_THROWN) || BitStream.Version() >= 0x4D)
18231822
{
18241823
CWeapon* pLastWeapon = m_pLocalPlayer->GetWeapon(m_lastWeaponSlot);
18251824
if (pLastWeapon && pLastWeapon->GetAmmoTotal() == 0 &&
1826-
(m_lastWeaponSlot == WEAPONSLOT_TYPE_THROWN ||
1827-
(BitStream.Version() >= 0x5A && (m_lastWeaponSlot == WEAPONSLOT_TYPE_HEAVY || m_lastWeaponSlot == WEAPONSLOT_TYPE_SPECIAL))))
1825+
(m_lastWeaponSlot == WEAPONSLOT_TYPE_THROWN || m_lastWeaponSlot == WEAPONSLOT_TYPE_HEAVY || m_lastWeaponSlot == WEAPONSLOT_TYPE_SPECIAL))
18281826
BitStream.WriteBit(true);
18291827
else
18301828
BitStream.WriteBit(false);

Client/mods/deathmatch/logic/CNetAPI.cpp

Lines changed: 6 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,9 +1287,7 @@ void CNetAPI::ReadVehiclePuresync(CClientPlayer* pPlayer, CClientVehicle* pVehic
12871287
// differs from the local one (#8800)
12881288
int iModelID = pVehicle->GetModel();
12891289
int iRemoteModelID = iModelID;
1290-
1291-
if (BitStream.Version() >= 0x05F)
1292-
BitStream.Read(iRemoteModelID);
1290+
BitStream.Read(iRemoteModelID);
12931291

12941292
eClientVehicleType remoteVehicleType = CClientVehicleManager::GetVehicleType(iRemoteModelID);
12951293
eClientVehicleType vehicleType = pVehicle->GetVehicleType();
@@ -1478,7 +1476,7 @@ void CNetAPI::ReadVehiclePuresync(CClientPlayer* pPlayer, CClientVehicle* pVehic
14781476
}
14791477

14801478
// Read out the weapon ammo
1481-
SWeaponAmmoSync ammo(ucCurrentWeapon, BitStream.Version() >= 0x44, true);
1479+
SWeaponAmmoSync ammo(ucCurrentWeapon, true, true);
14821480
BitStream.Read(&ammo);
14831481
unsigned short usWeaponAmmo = ammo.data.usAmmoInClip;
14841482

@@ -1487,7 +1485,7 @@ void CNetAPI::ReadVehiclePuresync(CClientPlayer* pPlayer, CClientVehicle* pVehic
14871485
CWeapon* pPlayerWeapon = pPlayer->GiveWeapon(static_cast<eWeaponType>(ucCurrentWeapon), usWeaponAmmo, true);
14881486
if (pPlayerWeapon)
14891487
{
1490-
pPlayerWeapon->SetAmmoTotal(BitStream.Version() >= 0x44 ? ammo.data.usTotalAmmo : 9999);
1488+
pPlayerWeapon->SetAmmoTotal(ammo.data.usTotalAmmo);
14911489
pPlayerWeapon->SetAmmoInClip(usWeaponAmmo);
14921490
}
14931491
}
@@ -1571,8 +1569,7 @@ void CNetAPI::WriteVehiclePuresync(CClientPed* pPlayerModel, CClientVehicle* pVe
15711569
iModelID = pVehicle->GetModelInfo()->GetParentID();
15721570

15731571
// Write the clientside model
1574-
if (BitStream.Version() >= 0x05F)
1575-
BitStream.Write(iModelID);
1572+
BitStream.Write(iModelID);
15761573

15771574
// Grab the vehicle position
15781575
CVector vecPosition;
@@ -1664,38 +1661,6 @@ void CNetAPI::WriteVehiclePuresync(CClientPed* pPlayerModel, CClientVehicle* pVe
16641661
BitStream.WriteBit(false);
16651662
}
16661663

1667-
// Update Damage Info if changed
1668-
if (BitStream.Version() >= 0x047)
1669-
{
1670-
if (!g_pClientGame->GetDamageSent())
1671-
{
1672-
g_pClientGame->SetDamageSent(true);
1673-
1674-
ElementID DamagerID = g_pClientGame->GetDamagerID();
1675-
if (DamagerID != RESERVED_ELEMENT_ID)
1676-
{
1677-
BitStream.WriteBit(true);
1678-
BitStream.Write(DamagerID);
1679-
1680-
SWeaponTypeSync weaponType;
1681-
weaponType.data.ucWeaponType = g_pClientGame->GetDamageWeapon();
1682-
BitStream.Write(&weaponType);
1683-
1684-
SBodypartSync bodypart;
1685-
bodypart.data.uiBodypart = g_pClientGame->GetDamageBodyPiece();
1686-
BitStream.Write(&bodypart);
1687-
}
1688-
else
1689-
{
1690-
BitStream.WriteBit(false);
1691-
}
1692-
}
1693-
else
1694-
{
1695-
BitStream.WriteBit(false);
1696-
}
1697-
}
1698-
16991664
// Player health sync (scaled from 0.0f-200.0f to 0-255 to save three bytes).
17001665
// Scale goes up to 200.0f because having max stats gives you the double of health.
17011666
SPlayerHealthSync health;
@@ -1738,7 +1703,7 @@ void CNetAPI::WriteVehiclePuresync(CClientPed* pPlayerModel, CClientVehicle* pVe
17381703
if (flags.data.bIsDoingGangDriveby && CWeaponNames::DoesSlotHaveAmmo(uiSlot))
17391704
{
17401705
// Write the ammo states
1741-
SWeaponAmmoSync ammo(pPlayerWeapon->GetType(), BitStream.Version() >= 0x44, true);
1706+
SWeaponAmmoSync ammo(pPlayerWeapon->GetType(), true, true);
17421707
ammo.data.usAmmoInClip = static_cast<unsigned short>(pPlayerWeapon->GetAmmoInClip());
17431708
ammo.data.usTotalAmmo = static_cast<unsigned short>(pPlayerWeapon->GetAmmoTotal());
17441709
BitStream.Write(&ammo);
@@ -1984,8 +1949,7 @@ void CNetAPI::WriteCameraSync(NetBitStreamInterface& BitStream)
19841949
{
19851950
CClientCamera* pCamera = m_pManager->GetCamera();
19861951

1987-
if (BitStream.Version() >= 0x05E)
1988-
BitStream.Write(pCamera->GetSyncTimeContext());
1952+
BitStream.Write(pCamera->GetSyncTimeContext());
19891953

19901954
// Are we in fixed mode?
19911955
bool bFixed = pCamera->IsInFixedMode();
@@ -2235,9 +2199,6 @@ void CNetAPI::ReadVehicleResync(CClientVehicle* pVehicle, NetBitStreamInterface&
22352199

22362200
void CNetAPI::ReadVehiclePartsState(CClientVehicle* pVehicle, NetBitStreamInterface& BitStream)
22372201
{
2238-
if (BitStream.Version() < 0x5D)
2239-
return;
2240-
22412202
SVehicleDamageSyncMethodeB damage;
22422203
BitStream.Read(&damage);
22432204
bool flyingComponents = m_pVehicleManager->IsSpawnFlyingComponentEnabled();

0 commit comments

Comments
 (0)