Skip to content

Commit

Permalink
server: reduce hornetgun recharge time only in multiplayer.
Browse files Browse the repository at this point in the history
  • Loading branch information
nekonomicon committed Nov 18, 2023
1 parent 1e4663a commit 78c0036
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions dlls/hornetgun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,12 @@ void CHgun::PrimaryAttack()
CBaseEntity *pHornet = CBaseEntity::Create( "hornet", m_pPlayer->GetGunPosition() + gpGlobals->v_forward * 16.0f + gpGlobals->v_right * 8.0f + gpGlobals->v_up * -12.0f, m_pPlayer->pev->v_angle, m_pPlayer->edict() );
pHornet->pev->velocity = gpGlobals->v_forward * 300.0f;

m_flRechargeTime = gpGlobals->time + 0.5f;
float flRechargeTimePause = 0.5f;

if( g_pGameRules->IsMultiplayer() )
flRechargeTimePause = 0.3f;

m_flRechargeTime = gpGlobals->time + flRechargeTimePause;
#endif
m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--;

Expand Down Expand Up @@ -223,8 +228,14 @@ void CHgun::SecondaryAttack( void )

pHornet->SetThink( &CHornet::StartDart );

m_flRechargeTime = gpGlobals->time + 0.5f;
float flRechargeTimePause = 0.5f;

if( g_pGameRules->IsMultiplayer() )
flRechargeTimePause = 0.3f;

m_flRechargeTime = gpGlobals->time + flRechargeTimePause;
#endif

int flags;
#if CLIENT_WEAPONS
flags = FEV_NOTHOST;
Expand All @@ -251,8 +262,16 @@ void CHgun::Reload( void )

while( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] < HORNET_MAX_CARRY && m_flRechargeTime < gpGlobals->time )
{
float flRechargeTimePause = 0.5f;
#if CLIENT_DLL
if( bIsMultiplayer() )
#else
if( g_pGameRules->IsMultiplayer() )
#endif
flRechargeTimePause = 0.3f;

m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]++;
m_flRechargeTime += 0.3f;
m_flRechargeTime += flRechargeTimePause;
}
}

Expand Down

0 comments on commit 78c0036

Please sign in to comment.