Browse Source

Fix melee weapons damage.

half-screwed
Andrey Akhmichin 2 years ago
parent
commit
4e85533681
No known key found for this signature in database
GPG Key ID: 1F180D249B0643C0
  1. 9
      dlls/hs/beamkatana.cpp
  2. 9
      dlls/hs/fotns.cpp

9
dlls/hs/beamkatana.cpp

@ -262,7 +262,14 @@ int CBeamKatana::Swing( int fFirst )
ClearMultiDamage( ); ClearMultiDamage( );
if ( (m_flNextPrimaryAttack + 1 < UTIL_WeaponTimeBase() ) || g_pGameRules->IsMultiplayer() ) // 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 // first swing does full damage
pEntity->TraceAttack(m_pPlayer->pev, gSkillData.plrDmgBeamKatana, gpGlobals->v_forward, &tr, DMG_CLUB ); pEntity->TraceAttack(m_pPlayer->pev, gSkillData.plrDmgBeamKatana, gpGlobals->v_forward, &tr, DMG_CLUB );

9
dlls/hs/fotns.cpp

@ -279,7 +279,14 @@ int CFOTN::Swing( int fFirst )
ClearMultiDamage( ); ClearMultiDamage( );
if ( (m_flNextPrimaryAttack + 1 < UTIL_WeaponTimeBase() ) || g_pGameRules->IsMultiplayer() ) // 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 // first swing does full damage
pEntity->TraceAttack(m_pPlayer->pev, gSkillData.plrDmgFOTN, gpGlobals->v_forward, &tr, DMG_CLUB ); pEntity->TraceAttack(m_pPlayer->pev, gSkillData.plrDmgFOTN, gpGlobals->v_forward, &tr, DMG_CLUB );

Loading…
Cancel
Save