diff --git a/regamedll/dlls/client.cpp b/regamedll/dlls/client.cpp index 4f3245af3..fefc9f42f 100644 --- a/regamedll/dlls/client.cpp +++ b/regamedll/dlls/client.cpp @@ -4822,6 +4822,16 @@ int EXT_FUNC GetWeaponData(edict_t *pEdict, struct weapon_data_s *info) item->fuser2 = weapon->m_flStartThrow; item->fuser3 = weapon->m_flReleaseThrow; item->iuser1 = weapon->m_iSwing; + +#ifdef REGAMEDLL_FIXES + if (pPlayerItem == pPlayer->m_pActiveItem && !weapon->m_fInReload && weapon->m_iClip == II.iMaxClip) + { + const WeaponInfoStruct *wpnInfo = GetDefaultWeaponInfo(II.iId); + + if (wpnInfo && wpnInfo->gunClipSize != II.iMaxClip) + item->m_iClip = wpnInfo->gunClipSize; + } +#endif } } diff --git a/regamedll/dlls/weapontype.cpp b/regamedll/dlls/weapontype.cpp index 209c7b89d..2b8ae4458 100644 --- a/regamedll/dlls/weapontype.cpp +++ b/regamedll/dlls/weapontype.cpp @@ -529,6 +529,17 @@ WeaponInfoStruct *GetWeaponInfo(const char *weaponName) return nullptr; } +WeaponInfoStruct *GetDefaultWeaponInfo(int weaponID) +{ + for (auto& info : g_weaponInfo_default) { + if (info.id == weaponID) { + return &info; + } + } + + return nullptr; +} + AmmoInfoStruct *GetAmmoInfo(const char *ammoName) { for (auto& info : g_ammoInfo) { diff --git a/regamedll/dlls/weapontype.h b/regamedll/dlls/weapontype.h index 97752ec8f..2005b6af7 100644 --- a/regamedll/dlls/weapontype.h +++ b/regamedll/dlls/weapontype.h @@ -445,6 +445,8 @@ void WeaponInfoReset(); WeaponInfoStruct *GetWeaponInfo(int weaponID); WeaponInfoStruct *GetWeaponInfo(const char *weaponName); +WeaponInfoStruct *GetDefaultWeaponInfo(int weaponID); + AmmoInfoStruct *GetAmmoInfo(AmmoType ammoID); AmmoInfoStruct *GetAmmoInfo(const char *ammoName);