Skip to content

Commit ca22eda

Browse files
committed
Improve check in CSimBulletsyncPacket::Read
1 parent b99cb95 commit ca22eda

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

Server/mods/deathmatch/logic/CPickupManager.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ bool CPickupManager::IsValidWeaponID(unsigned int uiWeaponID)
6868
return (uiWeaponID > 0 && uiWeaponID != 13 && uiWeaponID != 19 && uiWeaponID != 20 && uiWeaponID != 21 && uiWeaponID <= 46);
6969
}
7070

71+
bool CPickupManager::HasWeaponBulletSync(uint32_t weaponID)
72+
{
73+
return weaponID >= 22 && weaponID <= 34;
74+
}
75+
7176
unsigned short CPickupManager::GetWeaponModel(unsigned int uiWeaponID)
7277
{
7378
if (uiWeaponID <= 46)

Server/mods/deathmatch/logic/CPickupManager.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class CPickupManager
3636
std::list<CPickup*>::const_iterator IterEnd() { return m_List.end(); };
3737

3838
static bool IsValidWeaponID(unsigned int uiWeaponID);
39+
static bool HasWeaponBulletSync(uint32_t weaponID);
3940
static unsigned short GetWeaponModel(unsigned int uiWeaponID);
4041
static unsigned short GetHealthModel() { return 1240; };
4142
static unsigned short GetArmorModel() { return 1242; };

Server/mods/deathmatch/logic/net/CSimBulletsyncPacket.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ bool CSimBulletsyncPacket::Read(NetBitStreamInterface& BitStream)
2626
{
2727
char cWeaponType;
2828
BitStream.Read(cWeaponType);
29-
if (!CPickupManager::IsValidWeaponID(cWeaponType))
29+
if (!CPickupManager::HasWeaponBulletSync(cWeaponType))
3030
return false;
3131
m_Cache.weaponType = (eWeaponType)cWeaponType;
3232

0 commit comments

Comments
 (0)