Skip to content

Commit

Permalink
Added Python's missing reload sound (see ValveSoftware#1585)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelTroch committed Feb 26, 2015
1 parent 22ffc2e commit 238d9c5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions dlls/python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,21 @@ void CPython::Reload( void )
#endif

DefaultReload( 6, PYTHON_RELOAD, 2.0, bUseScope );
SetThink( &CPython::PlayReloadSound );
pev->nextthink = gpGlobals->time + 1.9;
}

void CPython::PlayReloadSound( void )
{
// Don't play the sound if we switched to another weapon then back to the
// Python if we were reloading it.
if ( m_fInReload )
{
EMIT_SOUND( ENT( pev ), CHAN_ITEM, "weapons/357_reload1.wav", 1.0, ATTN_NORM );
SetThink( NULL );
pev->nextthink = gpGlobals->time;
}
}

void CPython::WeaponIdle( void )
{
Expand Down
1 change: 1 addition & 0 deletions dlls/weapons.h
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ class CPython : public CBasePlayerWeapon
BOOL Deploy( void );
void Holster( int skiplocal = 0 );
void Reload( void );
void EXPORT PlayReloadSound( void );
void WeaponIdle( void );

BOOL m_fInZoom;// don't save this.
Expand Down

0 comments on commit 238d9c5

Please sign in to comment.