Skip to content

Commit

Permalink
Whitespace cleaning and pointer safety check
Browse files Browse the repository at this point in the history
  • Loading branch information
dystopm committed Sep 11, 2023
1 parent 1f0a1e9 commit d4d3215
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions regamedll/dlls/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4823,13 +4823,13 @@ int EXT_FUNC GetWeaponData(edict_t *pEdict, struct weapon_data_s *info)
item->fuser3 = weapon->m_flReleaseThrow;
item->iuser1 = weapon->m_iSwing;

#ifdef REGAMEDLL_FIXES
#ifdef REGAMEDLL_FIXES
if (pPlayerItem == pPlayer->m_pActiveItem && weapon->m_iClip == II.iMaxClip)
{
const WeaponInfoStruct *wpnInfo = GetDefaultWeaponInfo(II.iId);

if (wpnInfo->gunClipSize != II.iMaxClip)
item->m_iClip = wpnInfo->gunClipSize;
if (wpnInfo && wpnInfo->gunClipSize != II.iMaxClip)
item->m_iClip = wpnInfo->gunClipSize;
}
#endif
}
Expand Down
1 change: 0 additions & 1 deletion regamedll/dlls/weapontype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,6 @@ WeaponInfoStruct *GetWeaponInfo(const char *weaponName)
return nullptr;
}


WeaponInfoStruct *GetDefaultWeaponInfo(int weaponID)
{
for (auto& info : g_weaponInfo_default) {
Expand Down

0 comments on commit d4d3215

Please sign in to comment.