Browse Source

Override UseDecrement and iItemSlot calls. Fix weapons reload.

eftd
Night Owl 7 years ago
parent
commit
dcc13109b9
  1. 3
      cl_dll/health.cpp
  2. 2
      dlls/eftd/ak47.cpp
  3. 2
      dlls/eftd/mac10.cpp
  4. 18
      dlls/weapons.h

3
cl_dll/health.cpp

@ -187,9 +187,6 @@ int CHudHealth::Draw( float flTime ) @@ -187,9 +187,6 @@ int CHudHealth::Draw( float flTime )
if( ( gHUD.m_iHideHUDDisplay & HIDEHUD_HEALTH ) || gEngfuncs.IsSpectateOnly() )
return 1;
if( !m_hSprite )
m_hSprite = LoadSprite( "sprites/%d_pain.spr" );
if( !( gHUD.m_iWeaponBits & ( 1 << ( WEAPON_SUIT ) ) ) )
return 1;

2
dlls/eftd/ak47.cpp

@ -185,7 +185,7 @@ void CAK47::PrimaryAttack() @@ -185,7 +185,7 @@ void CAK47::PrimaryAttack()
void CAK47::Reload(void)
{
if (m_pPlayer->ammo_ak47 <= 0)
if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 || m_iClip == AK47_MAX_CLIP )
return;
DefaultReload(AK47_MAX_CLIP, AK47_RELOAD, 2.0);

2
dlls/eftd/mac10.cpp

@ -170,7 +170,7 @@ void CMac10::PrimaryAttack() @@ -170,7 +170,7 @@ void CMac10::PrimaryAttack()
void CMac10::Reload(void)
{
if (m_pPlayer->ammo_mac10 <= 0)
if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 || m_iClip == MAC10_MAX_CLIP )
return;
DefaultReload(MAC10_MAX_CLIP, MAC10_RELOAD, 3.2);

18
dlls/weapons.h

@ -1023,6 +1023,7 @@ class CAK47 : public CBasePlayerWeapon @@ -1023,6 +1023,7 @@ class CAK47 : public CBasePlayerWeapon
public:
void Spawn( void );
void Precache( void );
int iItemSlot( void ) { return 3; }
int GetItemInfo( ItemInfo *p );
BOOL AddToPlayer( CBasePlayer *pPlayer );
@ -1031,6 +1032,14 @@ public: @@ -1031,6 +1032,14 @@ public:
void Reload( void );
void WeaponIdle( void );
BOOL UseDecrement( void )
{
#if defined( CLIENT_WEAPONS )
return TRUE;
#else
return FALSE;
#endif
}
private:
int m_iShell;
unsigned short m_usAK47;
@ -1041,6 +1050,7 @@ class CMac10 : public CBasePlayerWeapon @@ -1041,6 +1050,7 @@ class CMac10 : public CBasePlayerWeapon
public:
void Spawn( void );
void Precache( void );
int iItemSlot( void ) { return 2; }
int GetItemInfo( ItemInfo *p );
BOOL AddToPlayer( CBasePlayer *pPlayer );
@ -1049,6 +1059,14 @@ public: @@ -1049,6 +1059,14 @@ public:
void Reload( void );
void WeaponIdle( void );
BOOL UseDecrement( void )
{
#if defined( CLIENT_WEAPONS )
return TRUE;
#else
return FALSE;
#endif
}
private:
int m_iShell;
unsigned short m_usMac10;

Loading…
Cancel
Save