|
|
|
@ -219,32 +219,32 @@ int CCrowbar::Swing( int fFirst )
@@ -219,32 +219,32 @@ int CCrowbar::Swing( int fFirst )
|
|
|
|
|
fDidHit = TRUE; |
|
|
|
|
CBaseEntity *pEntity = CBaseEntity::Instance( tr.pHit ); |
|
|
|
|
|
|
|
|
|
ClearMultiDamage(); |
|
|
|
|
// If building with the clientside weapon prediction system,
|
|
|
|
|
// UTIL_WeaponTimeBase() is always 0 and m_flNextPrimaryAttack is >= -1.0f, thus making
|
|
|
|
|
// m_flNextPrimaryAttack + 1 < UTIL_WeaponTimeBase() always evaluate to false.
|
|
|
|
|
#ifdef CLIENT_WEAPONS |
|
|
|
|
if( ( m_flNextPrimaryAttack + 1 == UTIL_WeaponTimeBase() ) || g_pGameRules->IsMultiplayer() ) |
|
|
|
|
#else |
|
|
|
|
if( ( m_flNextPrimaryAttack + 1 < UTIL_WeaponTimeBase() ) || g_pGameRules->IsMultiplayer() ) |
|
|
|
|
#endif |
|
|
|
|
{ |
|
|
|
|
// first swing does full damage
|
|
|
|
|
pEntity->TraceAttack( m_pPlayer->pev, gSkillData.plrDmgCrowbar, gpGlobals->v_forward, &tr, DMG_CLUB ); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
// subsequent swings do half
|
|
|
|
|
pEntity->TraceAttack( m_pPlayer->pev, gSkillData.plrDmgCrowbar / 2, gpGlobals->v_forward, &tr, DMG_CLUB ); |
|
|
|
|
} |
|
|
|
|
ApplyMultiDamage( m_pPlayer->pev, m_pPlayer->pev ); |
|
|
|
|
|
|
|
|
|
// play thwack, smack, or dong sound
|
|
|
|
|
float flVol = 1.0; |
|
|
|
|
int fHitWorld = TRUE; |
|
|
|
|
float flVol = 1.0; |
|
|
|
|
int fHitWorld = TRUE; |
|
|
|
|
|
|
|
|
|
if( pEntity ) |
|
|
|
|
{ |
|
|
|
|
ClearMultiDamage(); |
|
|
|
|
// If building with the clientside weapon prediction system,
|
|
|
|
|
// UTIL_WeaponTimeBase() is always 0 and m_flNextPrimaryAttack is >= -1.0f, thus making
|
|
|
|
|
// m_flNextPrimaryAttack + 1 < UTIL_WeaponTimeBase() always evaluate to false.
|
|
|
|
|
#ifdef CLIENT_WEAPONS |
|
|
|
|
if( ( m_flNextPrimaryAttack + 1 == UTIL_WeaponTimeBase() ) || g_pGameRules->IsMultiplayer() ) |
|
|
|
|
#else |
|
|
|
|
if( ( m_flNextPrimaryAttack + 1 < UTIL_WeaponTimeBase() ) || g_pGameRules->IsMultiplayer() ) |
|
|
|
|
#endif |
|
|
|
|
{ |
|
|
|
|
// first swing does full damage
|
|
|
|
|
pEntity->TraceAttack( m_pPlayer->pev, gSkillData.plrDmgCrowbar, gpGlobals->v_forward, &tr, DMG_CLUB ); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
// subsequent swings do half
|
|
|
|
|
pEntity->TraceAttack( m_pPlayer->pev, gSkillData.plrDmgCrowbar / 2, gpGlobals->v_forward, &tr, DMG_CLUB ); |
|
|
|
|
} |
|
|
|
|
ApplyMultiDamage( m_pPlayer->pev, m_pPlayer->pev ); |
|
|
|
|
|
|
|
|
|
if( pEntity->Classify() != CLASS_NONE && pEntity->Classify() != CLASS_MACHINE ) |
|
|
|
|
{ |
|
|
|
|
// play thwack or smack sound
|
|
|
|
|