Browse Source

Add WEAPONS_ANIMATION_TIMES_FIX macros for fixing some weapons animation times

hlfixed
Roman Chistokhodov 2 years ago
parent
commit
12a2aeb3c1
  1. 6
      CMakeLists.txt
  2. 4
      dlls/crowbar.cpp
  3. 5
      dlls/rpg.cpp
  4. 17
      dlls/satchel.cpp
  5. 9
      dlls/squeakgrenade.cpp

6
CMakeLists.txt

@ -66,6 +66,7 @@ option(CROWBAR_FIX_RAPID_CROWBAR "Enable rapid crowbar fix" OFF)
option(GAUSS_OVERCHARGE_FIX "Enable gauss overcharge fix" OFF) option(GAUSS_OVERCHARGE_FIX "Enable gauss overcharge fix" OFF)
option(TRIPMINE_BEAM_DUPLICATION_FIX "Enable fix of tripmine beam duplication on level transition" OFF) option(TRIPMINE_BEAM_DUPLICATION_FIX "Enable fix of tripmine beam duplication on level transition" OFF)
option(HANDGRENADE_DEPLOY_FIX "Enable handgrenade deploy animation fix after finishing a throw" OFF) option(HANDGRENADE_DEPLOY_FIX "Enable handgrenade deploy animation fix after finishing a throw" OFF)
option(WEAPONS_ANIMATION_TIMES_FIX "Enable animation times fix for some weapons" OFF)
option(OEM_BUILD "Enable OEM Build" OFF) option(OEM_BUILD "Enable OEM Build" OFF)
option(HLDEMO_BUILD "Enable Demo Build" OFF) option(HLDEMO_BUILD "Enable Demo Build" OFF)
@ -148,6 +149,11 @@ if(HANDGRENADE_DEPLOY_FIX)
add_definitions(-DHANDGRENADE_DEPLOY_FIX) add_definitions(-DHANDGRENADE_DEPLOY_FIX)
endif() endif()
if(WEAPONS_ANIMATION_TIMES_FIX)
message(STATUS "Weapons animation times fix enabled")
add_definitions(-DWEAPONS_ANIMATION_TIMES_FIX)
endif()
if(OEM_BUILD) if(OEM_BUILD)
message(STATUS "OEM build enabled") message(STATUS "OEM build enabled")
add_definitions(-DOEM_BUILD) add_definitions(-DOEM_BUILD)

4
dlls/crowbar.cpp

@ -366,7 +366,11 @@ void CCrowbar::WeaponIdle( void )
if( flRand > 0.5f ) if( flRand > 0.5f )
{ {
iAnim = CROWBAR_IDLE; iAnim = CROWBAR_IDLE;
#if WEAPONS_ANIMATION_TIMES_FIX
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0f / 25.0f;
#else
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0f / 30.0f; m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0f / 30.0f;
#endif
} }
else else
{ {

5
dlls/rpg.cpp

@ -518,8 +518,11 @@ void CRpg::WeaponIdle( void )
iAnim = RPG_FIDGET_UL; iAnim = RPG_FIDGET_UL;
else else
iAnim = RPG_FIDGET; iAnim = RPG_FIDGET;
#if WEAPONS_ANIMATION_TIMES_FIX
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 6.1f;
#else
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0f; m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0f;
#endif
} }
SendWeaponAnim( iAnim ); SendWeaponAnim( iAnim );

17
dlls/satchel.cpp

@ -293,14 +293,25 @@ BOOL CSatchel::CanDeploy( void )
BOOL CSatchel::Deploy() BOOL CSatchel::Deploy()
{ {
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0f; m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0f;
#if !WEAPONS_ANIMATION_TIMES_FIX
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10.0f, 15.0f ); m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10.0f, 15.0f );
#endif
BOOL result;
if( m_chargeReady ) if( m_chargeReady )
return DefaultDeploy( "models/v_satchel_radio.mdl", "models/p_satchel_radio.mdl", SATCHEL_RADIO_DRAW, "hive" ); result = DefaultDeploy( "models/v_satchel_radio.mdl", "models/p_satchel_radio.mdl", SATCHEL_RADIO_DRAW, "hive" );
else else
return DefaultDeploy( "models/v_satchel.mdl", "models/p_satchel.mdl", SATCHEL_DRAW, "trip" ); result = DefaultDeploy( "models/v_satchel.mdl", "models/p_satchel.mdl", SATCHEL_DRAW, "trip" );
return TRUE; #if WEAPONS_ANIMATION_TIMES_FIX
if ( result )
{
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0f;
}
#endif
return result;
} }
void CSatchel::Holster( int skiplocal /* = 0 */ ) void CSatchel::Holster( int skiplocal /* = 0 */ )

9
dlls/squeakgrenade.cpp

@ -465,7 +465,14 @@ BOOL CSqueak::Deploy()
m_pPlayer->m_iWeaponVolume = QUIET_GUN_VOLUME; m_pPlayer->m_iWeaponVolume = QUIET_GUN_VOLUME;
return DefaultDeploy( "models/v_squeak.mdl", "models/p_squeak.mdl", SQUEAK_UP, "squeak" ); const BOOL result = DefaultDeploy( "models/v_squeak.mdl", "models/p_squeak.mdl", SQUEAK_UP, "squeak" );
#if WEAPONS_ANIMATION_TIMES_FIX
if ( result )
{
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.7f;
}
#endif
return result;
} }
void CSqueak::Holster( int skiplocal /* = 0 */ ) void CSqueak::Holster( int skiplocal /* = 0 */ )

Loading…
Cancel
Save