Skip to content

Commit

Permalink
Fix rpg reload reading uninitialized variable
Browse files Browse the repository at this point in the history
Resolves #42
  • Loading branch information
SamVanheer committed Oct 21, 2021
1 parent d02b687 commit c82c3fa
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions dlls/rpg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,6 @@ void CRpgRocket :: FollowThink()

void CRpg::Reload()
{
int iResult;

if ( m_iClip == 1 )
{
// don't bother with any of this if don't need to reload.
Expand Down Expand Up @@ -307,11 +305,13 @@ void CRpg::Reload()
}
#endif

if ( m_iClip == 0 )
iResult = DefaultReload( RPG_MAX_CLIP, RPG_RELOAD, 2 );

if ( iResult )
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 );
if (m_iClip == 0)
{
const int iResult = DefaultReload(RPG_MAX_CLIP, RPG_RELOAD, 2);

if (iResult)
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat(m_pPlayer->random_seed, 10, 15);
}

}

Expand Down

0 comments on commit c82c3fa

Please sign in to comment.