mirror of
https://github.com/fortressforever/fortressforever-2013.git
synced 2025-02-16 00:52:21 +00:00
Added server convar ffdev_tfc_crouch_airmovement that controls whether or not TFC-style duck speed cropping is enabled
* In TFC, intended movement speed is cropped even while in the air; this basically means that you lose speed while crouched and air controlling at high speeds (lower speeds are largely unaffected)
This commit is contained in:
parent
0d12a7df4d
commit
b9afe7cf00
4 changed files with 29 additions and 1 deletions
|
@ -589,6 +589,28 @@ void CFF_SH_GameMovement::Duck( void )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Handles speed cropping while ducking
|
||||||
|
Overwritten from CGameMovement
|
||||||
|
Purpose: Allow for TFC-style duck speed cropping
|
||||||
|
*/
|
||||||
|
void CFF_SH_GameMovement::HandleDuckingSpeedCrop( void )
|
||||||
|
{
|
||||||
|
// in HL1/TFC, crouching altered intended movement speed even while in the air
|
||||||
|
// it basically makes you lose speed while air controlling at high speeds
|
||||||
|
if (FFDEV_TFC_CROUCH_AIRMOVEMENT && ( player->GetFlags() & FL_DUCKING ))
|
||||||
|
{
|
||||||
|
float frac = 0.33333333f;
|
||||||
|
mv->m_flForwardMove *= frac;
|
||||||
|
mv->m_flSideMove *= frac;
|
||||||
|
mv->m_flUpMove *= frac;
|
||||||
|
m_iSpeedCropped |= SPEED_CROPPED_DUCK;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BaseClass::HandleDuckingSpeedCrop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Expose our interface.
|
// Expose our interface.
|
||||||
// Note: There can only be one IGameMovement exposed at a time
|
// Note: There can only be one IGameMovement exposed at a time
|
||||||
static CFF_SH_GameMovement g_GameMovement;
|
static CFF_SH_GameMovement g_GameMovement;
|
||||||
|
|
|
@ -36,7 +36,8 @@ protected:
|
||||||
virtual bool CheckJumpButton( void );
|
virtual bool CheckJumpButton( void );
|
||||||
|
|
||||||
// Ducking
|
// Ducking
|
||||||
virtual void Duck( void );
|
virtual void Duck( void );
|
||||||
|
virtual void HandleDuckingSpeedCrop();
|
||||||
// <--- Overwritten functions
|
// <--- Overwritten functions
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -4,3 +4,5 @@
|
||||||
#ifdef CLIENT_DLL
|
#ifdef CLIENT_DLL
|
||||||
ConVar cl_jumpqueue( "cl_jumpqueue", "0", FCVAR_ARCHIVE | FCVAR_USERINFO, "Enables jump queue (have to let go and press jump in between concurrent jumps) if set to 1" );
|
ConVar cl_jumpqueue( "cl_jumpqueue", "0", FCVAR_ARCHIVE | FCVAR_USERINFO, "Enables jump queue (have to let go and press jump in between concurrent jumps) if set to 1" );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
ConVar ffdev_tfc_crouch_airmovement( "ffdev_tfc_crouch_airmovement", "0", FCVAR_REPLICATED, "Enables/disables 'slower' movement while in the air; in TFC, crouching cuts your desired movement in 1/3 even in the air" );
|
|
@ -15,6 +15,9 @@ extern bool g_bMovementOptimizations;
|
||||||
#define SV_TRIMPTRIGGERSPEED 550.0f
|
#define SV_TRIMPTRIGGERSPEED 550.0f
|
||||||
#define SV_TRIMPTRIGGERSPEEDDOWN 50.0f
|
#define SV_TRIMPTRIGGERSPEEDDOWN 50.0f
|
||||||
|
|
||||||
|
extern ConVar ffdev_tfc_crouch_airmovement;
|
||||||
|
#define FFDEV_TFC_CROUCH_AIRMOVEMENT ffdev_tfc_crouch_airmovement.GetBool()
|
||||||
|
|
||||||
#define BHOP_CAP_SOFT 1.4f
|
#define BHOP_CAP_SOFT 1.4f
|
||||||
#define BHOP_PCFACTOR 0.65f
|
#define BHOP_PCFACTOR 0.65f
|
||||||
#define BHOP_CAP_HARD 1.8f
|
#define BHOP_CAP_HARD 1.8f
|
||||||
|
|
Loading…
Reference in a new issue