mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-02-03 02:24:28 +00:00
Apply all an old crowbar fixes to other melee weapons.
This commit is contained in:
parent
14c157f6fc
commit
300187c7e4
@ -154,8 +154,10 @@ void CBeamKatana::PrimaryAttack()
|
||||
{
|
||||
if (! Swing( 1 ))
|
||||
{
|
||||
#if !CLIENT_DLL
|
||||
SetThink( &CBeamKatana::SwingAgain );
|
||||
pev->nextthink = gpGlobals->time + 0.1f;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -223,10 +225,12 @@ int CBeamKatana::Swing( int fFirst )
|
||||
}
|
||||
#endif
|
||||
|
||||
if( fFirst )
|
||||
{
|
||||
PLAYBACK_EVENT_FULL( FEV_NOTHOST, m_pPlayer->edict(), m_usBeamKatana,
|
||||
0.0, g_vecZero, g_vecZero, 0, 0, 0,
|
||||
0.0, 0, 0.0 );
|
||||
|
||||
}
|
||||
|
||||
if ( tr.flFraction >= 1.0f )
|
||||
{
|
||||
@ -260,6 +264,12 @@ int CBeamKatana::Swing( int fFirst )
|
||||
fDidHit = TRUE;
|
||||
CBaseEntity *pEntity = CBaseEntity::Instance(tr.pHit);
|
||||
|
||||
// play thwack, smack, or dong sound
|
||||
float flVol = 1.0;
|
||||
int fHitWorld = TRUE;
|
||||
|
||||
if (pEntity)
|
||||
{
|
||||
ClearMultiDamage( );
|
||||
|
||||
// If building with the clientside weapon prediction system,
|
||||
@ -281,12 +291,6 @@ int CBeamKatana::Swing( int fFirst )
|
||||
}
|
||||
ApplyMultiDamage( m_pPlayer->pev, m_pPlayer->pev );
|
||||
|
||||
// play thwack, smack, or dong sound
|
||||
float flVol = 1.0;
|
||||
int fHitWorld = TRUE;
|
||||
|
||||
if (pEntity)
|
||||
{
|
||||
if ( pEntity->Classify() != CLASS_NONE && pEntity->Classify() != CLASS_MACHINE )
|
||||
{
|
||||
// play thwack or smack sound
|
||||
@ -301,7 +305,12 @@ int CBeamKatana::Swing( int fFirst )
|
||||
}
|
||||
m_pPlayer->m_iWeaponVolume = BEAMKATANA_BODYHIT_VOLUME;
|
||||
if ( !pEntity->IsAlive() )
|
||||
{
|
||||
#ifdef CROWBAR_FIX_RAPID_CROWBAR
|
||||
m_flNextPrimaryAttack = GetNextAttackDelay(0.25);
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
flVol = 0.1;
|
||||
|
||||
@ -340,11 +349,11 @@ int CBeamKatana::Swing( int fFirst )
|
||||
}
|
||||
|
||||
m_pPlayer->m_iWeaponVolume = flVol * BEAMKATANA_WALLHIT_VOLUME;
|
||||
#endif
|
||||
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25f;
|
||||
|
||||
SetThink( &CBeamKatana::Smack );
|
||||
pev->nextthink = UTIL_WeaponTimeBase() + 0.2f;
|
||||
pev->nextthink = gpGlobals->time + 0.2f;
|
||||
#endif
|
||||
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25f;
|
||||
}
|
||||
return fDidHit;
|
||||
}
|
||||
|
@ -194,8 +194,10 @@ void CFOTN::PrimaryAttack()
|
||||
flWataDelay = flAhDelay;
|
||||
if (! Swing( 1 ))
|
||||
{
|
||||
#if !CLIENT_DLL
|
||||
SetThink( &CFOTN::SwingAgain );
|
||||
pev->nextthink = gpGlobals->time + 0.12f;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -248,10 +250,12 @@ int CFOTN::Swing( int fFirst )
|
||||
}
|
||||
#endif
|
||||
|
||||
if (fFirst)
|
||||
{
|
||||
PLAYBACK_EVENT_FULL( FEV_NOTHOST, m_pPlayer->edict(), m_usFOTN,
|
||||
0.0, g_vecZero, g_vecZero, 0, 0, 0,
|
||||
0.0, 0, 0.0 );
|
||||
|
||||
}
|
||||
|
||||
if ( tr.flFraction >= 1.0f )
|
||||
{
|
||||
@ -277,6 +281,12 @@ int CFOTN::Swing( int fFirst )
|
||||
fDidHit = TRUE;
|
||||
CBaseEntity *pEntity = CBaseEntity::Instance(tr.pHit);
|
||||
|
||||
// play thwack, smack, or dong sound
|
||||
float flVol = 1.0;
|
||||
int fHitWorld = TRUE;
|
||||
|
||||
if( pEntity )
|
||||
{
|
||||
ClearMultiDamage( );
|
||||
|
||||
// If building with the clientside weapon prediction system,
|
||||
@ -298,12 +308,6 @@ int CFOTN::Swing( int fFirst )
|
||||
}
|
||||
ApplyMultiDamage( m_pPlayer->pev, m_pPlayer->pev );
|
||||
|
||||
// play thwack, smack, or dong sound
|
||||
float flVol = 1.0;
|
||||
int fHitWorld = TRUE;
|
||||
|
||||
if (pEntity)
|
||||
{
|
||||
if ( pEntity->Classify() != CLASS_NONE && pEntity->Classify() != CLASS_MACHINE )
|
||||
{
|
||||
// play thwack or smack sound
|
||||
@ -318,7 +322,12 @@ int CFOTN::Swing( int fFirst )
|
||||
}
|
||||
m_pPlayer->m_iWeaponVolume = FOTN_BODYHIT_VOLUME;
|
||||
if ( !pEntity->IsAlive() )
|
||||
{
|
||||
#if CROWBAR_FIX_RAPID_CROWBAR
|
||||
m_flNextPrimaryAttack = GetNextAttackDelay(0.12);
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
flVol = 0.1;
|
||||
|
||||
@ -357,11 +366,11 @@ int CFOTN::Swing( int fFirst )
|
||||
}
|
||||
|
||||
m_pPlayer->m_iWeaponVolume = flVol * FOTN_WALLHIT_VOLUME;
|
||||
#endif
|
||||
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.12f;
|
||||
|
||||
SetThink( &CFOTN::Smack );
|
||||
pev->nextthink = UTIL_WeaponTimeBase() + 0.18f;
|
||||
pev->nextthink = gpGlobals->time + 0.18f;
|
||||
#endif
|
||||
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.12f;
|
||||
}
|
||||
return fDidHit;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user