Two handed weapons only triggered when < 40cm between controllers

This commit is contained in:
Simon 2022-03-20 09:44:39 +00:00
parent aa9e2899bd
commit f9fa5cc2b6
3 changed files with 17 additions and 7 deletions

View file

@ -1724,7 +1724,7 @@ void CG_AddViewWeapon( playerState_t *ps ) {
if (trap_Cvar_VariableValue("vr_lasersight") != 0.0f && !vr->no_crosshair) if (trap_Cvar_VariableValue("vr_lasersight") != 0.0f && !vr->no_crosshair)
{ {
vec3_t forward, end, dir; vec3_t forward, end;
AngleVectors(angles, forward, NULL, NULL); AngleVectors(angles, forward, NULL, NULL);
VectorMA(hand.origin, 4096, forward, end); VectorMA(hand.origin, 4096, forward, end);
trace_t trace; trace_t trace;
@ -2195,7 +2195,7 @@ void CG_DrawWeaponSelector( void )
vec3_t diff; vec3_t diff;
VectorSubtract(selectorOrigin, iconOrigin, diff); VectorSubtract(selectorOrigin, iconOrigin, diff);
float length = VectorLength(diff); float length = VectorLength(diff);
if (length <= 1.5f && if (length <= 1.4f &&
frac == 1.0f && frac == 1.0f &&
selectable) selectable)
{ {

View file

@ -1027,13 +1027,13 @@ GraphicsOptions_MenuInit
*/ */
void GraphicsOptions_MenuInit( void ) void GraphicsOptions_MenuInit( void )
{ {
static const char *s_driver_names[] = /* static const char *s_driver_names[] =
{ {
"Default", "Default",
"Voodoo", "Voodoo",
NULL NULL
}; };
*/
static const char *tq_names[] = static const char *tq_names[] =
{ {
"Default", "Default",
@ -1081,13 +1081,13 @@ void GraphicsOptions_MenuInit( void )
"High", "High",
NULL NULL
}; };
static const char *enabled_names[] = /* static const char *enabled_names[] =
{ {
"Off", "Off",
"On", "On",
NULL NULL
}; };
static const char *s_refreshrate[] = */ static const char *s_refreshrate[] =
{ {
"60", "60",
"72 (Recommended)", "72 (Recommended)",

View file

@ -259,7 +259,17 @@ static qboolean IN_SendButtonAction(const char* action, qboolean pressed, qboole
} }
else if (strcmp(action, "+weapon_stabilise") == 0) else if (strcmp(action, "+weapon_stabilise") == 0)
{ {
vr.weapon_stabilised = pressed; //stabilised weapon only triggered when controllers close enough (40cm) to each other
if (pressed)
{
vec3_t l;
VectorSubtract(vr.weaponposition, vr.offhandposition, l);
vr.weapon_stabilised = VectorLength(l) < 0.4f;
}
else
{
vr.weapon_stabilised = qfalse;
}
} }
//Special case for moveup as we can send a space key instead allowing us to skip //Special case for moveup as we can send a space key instead allowing us to skip
//server search in the server menu //server search in the server menu