Fix issue with two handed weapons preventing force wheel from showing

This commit is contained in:
Simon 2023-12-12 22:29:00 +00:00
parent c712a5ecff
commit f5c84bd51d

View file

@ -295,20 +295,26 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
if (offhandGripPushed) if (offhandGripPushed)
{ {
if (!vr.weapon_stabilised && vr.item_selector == 0 && if (!vr.weapon_stabilised && vr.item_selector == 0 &&
!vr.misc_camera && !vr.cgzoommode && vr_two_handed_weapons->integer) !vr.misc_camera && !vr.cgzoommode)
{
if (vr_two_handed_weapons->integer)
{ {
if (distance < STABILISATION_DISTANCE && if (distance < STABILISATION_DISTANCE &&
cl.frame.ps.weapon == WP_SABER) { cl.frame.ps.weapon == WP_SABER)
{
vr.weapon_stabilised = true; vr.weapon_stabilised = true;
} }
else { else
{
vec3_t dir, weaponposition, offhandposition; vec3_t dir, weaponposition, offhandposition;
VectorSet(weaponposition, pWeapon->Pose.position.z, pWeapon->Pose.position.x, pWeapon->Pose.position.y); VectorSet(weaponposition, pWeapon->Pose.position.z,
VectorSet(offhandposition, pOff->Pose.position.z, pOff->Pose.position.x, pOff->Pose.position.y); pWeapon->Pose.position.x, pWeapon->Pose.position.y);
VectorSet(offhandposition, pOff->Pose.position.z, pOff->Pose.position.x,
pOff->Pose.position.y);
VectorSubtract(weaponposition, offhandposition, dir); VectorSubtract(weaponposition, offhandposition, dir);
VectorNormalize(dir); VectorNormalize(dir);
vec3_t weaponangles, weaponForward, rotation = { 0 }; vec3_t weaponangles, weaponForward, rotation = {0};
rotation[PITCH] = vr_weapon_pitchadjust->value; rotation[PITCH] = vr_weapon_pitchadjust->value;
QuatToYawPitchRoll(pWeapon->Pose.orientation, rotation, weaponangles); QuatToYawPitchRoll(pWeapon->Pose.orientation, rotation, weaponangles);
AngleVectors(weaponangles, weaponForward, NULL, NULL); AngleVectors(weaponangles, weaponForward, NULL, NULL);
@ -320,6 +326,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
vr.weapon_stabilised = true; vr.weapon_stabilised = true;
} }
} }
}
if (!vr.weapon_stabilised) if (!vr.weapon_stabilised)
{ {