Small fixes

prevent laser sight suddenly being on after level transition
Slight weapon location adjustments
This commit is contained in:
Simon 2019-11-20 22:30:15 +00:00
parent ec9d37e857
commit df9f19cd70
5 changed files with 13 additions and 6 deletions

View file

@ -1342,12 +1342,12 @@ void VR_Init()
vr_walkdirection = Cvar_Get( "vr_walkdirection", "0", CVAR_ARCHIVE);
vr_weapon_pitchadjust = Cvar_Get( "vr_weapon_pitchadjust", "-20.0", CVAR_ARCHIVE);
vr_weapon_recoil = Cvar_Get( "vr_weapon_recoil", "0", CVAR_ARCHIVE);
vr_lasersight = Cvar_Get( "vr_lasersight", "0", CVAR_ARCHIVE);
vr_control_scheme = Cvar_Get( "vr_control_scheme", "0", CVAR_ARCHIVE);
vr_enable_crouching = Cvar_Get( "vr_enable_crouching", "0.85", CVAR_ARCHIVE);
vr_height_adjust = Cvar_Get( "vr_height_adjust", "0.0", CVAR_ARCHIVE);
vr_weaponscale = Cvar_Get( "vr_weaponscale", "0.56", CVAR_ARCHIVE);
vr_weapon_stabilised = Cvar_Get( "vr_weapon_stabilised", "0.0", CVAR_LATCH);
vr_lasersight = Cvar_Get( "vr_lasersight", "0", CVAR_LATCH);
//The Engine (which is a derivative of Quake) uses a very specific unit size:
//Wolfenstein 3D, DOOM and QUAKE use the same coordinate/unit system:

View file

@ -279,8 +279,12 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
(pDominantTrackedRemoteOld->Buttons & ovrButton_Joystick)
&& (pDominantTrackedRemoteNew->Buttons & ovrButton_Joystick)) {
Cvar_SetValue("vr_lasersight", 1.0f - vr_lasersight->value);
if (vr_lasersight->value != 0.0)
{
Cvar_ForceSet("vr_lasersight", "0.0");
} else {
Cvar_ForceSet("vr_lasersight", "1.0");
}
}
//Apply a filter and quadratic scaler so small movements are easier to make

View file

@ -1408,9 +1408,11 @@ void SetWeapon6DOF(int weapmodel, vec3_t origin, vec3_t gunorigin, vec3_t gunang
weapmodel == WEAP_MACHINEGUN)
VectorSet(offset, 17 * vr_weaponscale->value, lrOffset, -8 * vr_weaponscale->value);
else if (weapmodel == WEAP_SHOTGUN)
VectorSet(offset, 12 * vr_weaponscale->value, lrOffset * 1.1, -8 * vr_weaponscale->value);
VectorSet(offset, 12 * vr_weaponscale->value, lrOffset * 1.3, -8 * vr_weaponscale->value);
else if (weapmodel == WEAP_CHAINGUN)
VectorSet(offset, 3.5 * vr_weaponscale->value, lrOffset * 0.85, -8 * vr_weaponscale->value);
VectorSet(offset, 3.5 * vr_weaponscale->value, lrOffset * 0.73, -8 * vr_weaponscale->value);
else if (weapmodel == WEAP_ROCKETLAUNCHER)
VectorSet(offset, 10 * vr_weaponscale->value, lrOffset * 0.8, -8 * vr_weaponscale->value);
else if (weapmodel != 0)
VectorSet(offset, 10 * vr_weaponscale->value, lrOffset, -8 * vr_weaponscale->value);

View file

@ -233,6 +233,7 @@ void CL_ClearTEnts (void)
memset (cl_beams, 0, sizeof(cl_beams));
memset (cl_explosions, 0, sizeof(cl_explosions));
memset (cl_lasers, 0, sizeof(cl_lasers));
memset (&cl_lasersight, 0, sizeof(laser_t));
//ROGUE
memset (cl_playerbeams, 0, sizeof(cl_playerbeams));

View file

@ -455,7 +455,7 @@ void Weapon_Generic (edict_t *ent, int FRAME_ACTIVATE_LAST, int FRAME_FIRE_LAST,
}
//Laser sight?
if (vr_lasersight->value == 1.0f)
if (vr_lasersight->value != 0.0f)
{
gi.WriteByte (svc_temp_entity);
gi.WriteByte (TE_LASER_SIGHT);