- Duke: Allow view tilting for RRRA vehicles on separate CVAR.

* Tilts at the same angle as the HUD.
This commit is contained in:
Mitchell Richters 2023-04-24 23:20:05 +10:00
parent 918789705f
commit fd1c3dffe8
2 changed files with 16 additions and 2 deletions

View file

@ -32,6 +32,8 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
#include "mapinfo.h" #include "mapinfo.h"
#include "dukeactor.h" #include "dukeactor.h"
CVAR(Bool, cl_rrvehicletilting, false, CVAR_ARCHIVE);
BEGIN_DUKE_NS BEGIN_DUKE_NS
@ -723,9 +725,14 @@ static unsigned outVehicleFlags(player_struct* p, ESyncBits& actions)
static void doVehicleTilting(player_struct* const p, const bool canTilt) static void doVehicleTilting(player_struct* const p, const bool canTilt)
{ {
const auto pact = p->GetActor();
const auto adj = DAngle::fromDeg(p->sync.avel * 0.375 * canTilt);
p->oTiltStatus = p->TiltStatus; p->oTiltStatus = p->TiltStatus;
p->TiltStatus += DAngle::fromDeg(p->sync.avel * 0.375 * canTilt);
p->TiltStatus += adj;
pact->spr.Angles.Roll += adj * cl_rrvehicletilting;
scaletozero(p->TiltStatus, 10.); scaletozero(p->TiltStatus, 10.);
scaletozero(pact->spr.Angles.Roll, 10.);
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@ -2694,7 +2701,10 @@ void processinput_r(int snum)
} }
} }
p->Angles.doRollInput(&p->sync, p->vel.XY(), maxVel, (psectlotag == 1) || (psectlotag == 2)); if (!p->OnMotorcycle && !p->OnBoat)
{
p->Angles.doRollInput(&p->sync, p->vel.XY(), maxVel, (psectlotag == 1) || (psectlotag == 2));
}
HORIZONLY: HORIZONLY:

View file

@ -1140,6 +1140,10 @@ OptionMenu "VideoOptions" protected
} }
Option "$DSPLYMNU_VIEWTILTING", "cl_viewtilting", "ViewTilting" Option "$DSPLYMNU_VIEWTILTING", "cl_viewtilting", "ViewTilting"
Slider "$DSPLYMNU_VIEWTILTSCALE", "cl_viewtiltscale", 0.0, 2.0, 0.05 Slider "$DSPLYMNU_VIEWTILTSCALE", "cl_viewtiltscale", 0.0, 2.0, 0.05
ifgame (RedneckRides)
{
Option "$DSPLYMNU_VEHTILTING", "cl_rrvehicletilting", "OnOff"
}
Slider "$DSPLYMNU_FOV", "r_fov", 60, 130, 10, 1 Slider "$DSPLYMNU_FOV", "r_fov", 60, 130, 10, 1
StaticText "" StaticText ""