mirror of
https://github.com/FWGS/hlsdk-xash3d
synced 2024-11-22 01:47:45 +01:00
Add WEAPONS_ANIMATION_TIMES_FIX macros for fixing some weapons animation times
This commit is contained in:
parent
763af29054
commit
12a2aeb3c1
@ -66,6 +66,7 @@ option(CROWBAR_FIX_RAPID_CROWBAR "Enable rapid crowbar 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(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(HLDEMO_BUILD "Enable Demo Build" OFF)
|
||||
|
||||
@ -148,6 +149,11 @@ if(HANDGRENADE_DEPLOY_FIX)
|
||||
add_definitions(-DHANDGRENADE_DEPLOY_FIX)
|
||||
endif()
|
||||
|
||||
if(WEAPONS_ANIMATION_TIMES_FIX)
|
||||
message(STATUS "Weapons animation times fix enabled")
|
||||
add_definitions(-DWEAPONS_ANIMATION_TIMES_FIX)
|
||||
endif()
|
||||
|
||||
if(OEM_BUILD)
|
||||
message(STATUS "OEM build enabled")
|
||||
add_definitions(-DOEM_BUILD)
|
||||
|
@ -366,7 +366,11 @@ void CCrowbar::WeaponIdle( void )
|
||||
if( flRand > 0.5f )
|
||||
{
|
||||
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;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -518,8 +518,11 @@ void CRpg::WeaponIdle( void )
|
||||
iAnim = RPG_FIDGET_UL;
|
||||
else
|
||||
iAnim = RPG_FIDGET;
|
||||
|
||||
#if WEAPONS_ANIMATION_TIMES_FIX
|
||||
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 6.1f;
|
||||
#else
|
||||
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0f;
|
||||
#endif
|
||||
}
|
||||
|
||||
SendWeaponAnim( iAnim );
|
||||
|
@ -293,14 +293,25 @@ BOOL CSatchel::CanDeploy( void )
|
||||
BOOL CSatchel::Deploy()
|
||||
{
|
||||
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 );
|
||||
#endif
|
||||
|
||||
BOOL result;
|
||||
|
||||
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
|
||||
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 */ )
|
||||
|
@ -465,7 +465,14 @@ BOOL CSqueak::Deploy()
|
||||
|
||||
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 */ )
|
||||
|
Loading…
Reference in New Issue
Block a user