Browse Source

Fix weapons reload bug on save/restore.

half-screwed
Andrey Akhmichin 2 years ago
parent
commit
e4f4666f5d
No known key found for this signature in database
GPG Key ID: 1F180D249B0643C0
  1. 3
      dlls/hs/ak47.cpp
  2. 6
      dlls/hs/goldengun.cpp
  3. 6
      dlls/hs/jackal.cpp
  4. 4
      dlls/hs/modman.cpp
  5. 2
      dlls/hs/mw2.cpp
  6. 6
      dlls/hs/zapper.cpp

3
dlls/hs/ak47.cpp

@ -197,6 +197,9 @@ void CAK47::PrimaryAttack() @@ -197,6 +197,9 @@ void CAK47::PrimaryAttack()
void CAK47::Reload( void )
{
if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 || m_iClip == AK47_MAX_CLIP )
return;
DefaultReload( AK47_MAX_CLIP, AK47_RELOAD, 3.0 );
}

6
dlls/hs/goldengun.cpp

@ -169,12 +169,12 @@ void CGOLDENGUN::Reload( void ) @@ -169,12 +169,12 @@ void CGOLDENGUN::Reload( void )
{
int iResult;
if (m_iClip == GOLDENGUN_MAX_CLIP)
return;
if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 || m_iClip == GOLDENGUN_MAX_CLIP )
return;
if (m_iClip == 0)
{
iResult = DefaultReload( GOLDENGUN_MAX_CLIP, GOLDENGUN_RELOAD2, 2.7, 0 );
iResult = DefaultReload( GOLDENGUN_MAX_CLIP, GOLDENGUN_RELOAD, 2.7, 0 );
}
else
{

6
dlls/hs/jackal.cpp

@ -149,12 +149,12 @@ void CJackal::Reload( void ) @@ -149,12 +149,12 @@ void CJackal::Reload( void )
{
int iResult;
if (m_iClip == JACKAL_MAX_CLIP)
return;
if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 || m_iClip == JACKAL_MAX_CLIP )
return;
if (m_iClip == 0)
{
iResult = DefaultReload( JACKAL_MAX_CLIP, Jackal_RELOAD2, 2.7, 0 );
iResult = DefaultReload( JACKAL_MAX_CLIP, Jackal_RELOAD, 2.7, 0 );
}
else
{

4
dlls/hs/modman.cpp

@ -442,8 +442,10 @@ void CModman::FireHorn() @@ -442,8 +442,10 @@ void CModman::FireHorn()
void CModman::Reload( void )
{
if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 || m_iClip == CROSSBOW_MAX_CLIP )
return;
if ( DefaultReload( 5, CROSSBOW_RELOAD, 4.5 ) )
if ( DefaultReload( CROSSBOW_MAX_CLIP, CROSSBOW_RELOAD, 4.5 ) )
{
EMIT_SOUND_DYN(ENT(m_pPlayer->pev), CHAN_ITEM, "weapons/xbow_reload1.wav", RANDOM_FLOAT(0.95, 1.0), ATTN_NORM, 0, 93 + RANDOM_LONG(0,0xF));
}

2
dlls/hs/mw2.cpp

@ -185,6 +185,8 @@ void CMW2::PrimaryAttack() @@ -185,6 +185,8 @@ void CMW2::PrimaryAttack()
void CMW2::Reload( void )
{
if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 || m_iClip == MW2_MAX_CLIP )
return;
DefaultReload( MW2_MAX_CLIP, MW2_RELOAD, 3.0 );
}

6
dlls/hs/zapper.cpp

@ -164,8 +164,8 @@ void CZAPPER::Reload( void ) @@ -164,8 +164,8 @@ void CZAPPER::Reload( void )
{
int iResult;
if (m_iClip == ZAPPER_MAX_CLIP)
return;
if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 || m_iClip == ZAPPER_MAX_CLIP )
return;
if (m_iClip == 0)
{
@ -173,7 +173,7 @@ void CZAPPER::Reload( void ) @@ -173,7 +173,7 @@ void CZAPPER::Reload( void )
}
else
{
iResult = DefaultReload( ZAPPER_MAX_CLIP, ZAPPER_RELOAD, 1.5, 0 );
iResult = DefaultReload( ZAPPER_MAX_CLIP, ZAPPER_RELOAD_NOT_EMPTY, 1.5, 0 );
}
if (iResult)
{

Loading…
Cancel
Save