Skip to content

Commit

Permalink
Apply cutscene check consistently (#269)
Browse files Browse the repository at this point in the history
(joystick/keyboard look functions weren't updated
in commit 05a151b)
  • Loading branch information
andrei-drexler committed Nov 27, 2023
1 parent 05a151b commit 749dc2a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
12 changes: 11 additions & 1 deletion Quake/cl_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,16 @@ cvar_t cl_anglespeedkey = {"cl_anglespeedkey","1.5",CVAR_NONE};

cvar_t cl_alwaysrun = {"cl_alwaysrun","1",CVAR_ARCHIVE}; // QuakeSpasm -- new always run

/*
================
CL_InCutscene
================
*/
qboolean CL_InCutscene (void)
{
return cl.fixangle && !cl.viewent.model;
}

/*
================
CL_AdjustAngles
Expand All @@ -260,7 +270,7 @@ void CL_AdjustAngles (void)
float speed;
float up, down;

if (cl.fixangle)
if (CL_InCutscene ())
return;

if ((in_speed.state & 1) ^ (cl_alwaysrun.value != 0.0))
Expand Down
1 change: 1 addition & 0 deletions Quake/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ void CL_SendMove (const usercmd_t *cmd);
int CL_ReadFromServer (void);
void CL_AdjustAngles (void);
void CL_BaseMove (usercmd_t *cmd);
qboolean CL_InCutscene (void);

void CL_ParseTEnt (void);
void CL_UpdateTEnts (void);
Expand Down
5 changes: 2 additions & 3 deletions Quake/in_sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,7 @@ extern cvar_t scr_fov;

void IN_MouseMotion(int dx, int dy)
{
qboolean cutscene = cl.fixangle && !cl.viewent.model;
if (cls.state != ca_connected || cls.signon != SIGNONS || key_dest != key_game || cutscene)
if (cls.state != ca_connected || cls.signon != SIGNONS || key_dest != key_game || CL_InCutscene ())
{
total_dx = 0;
total_dy = 0;
Expand Down Expand Up @@ -642,7 +641,7 @@ void IN_JoyMove (usercmd_t *cmd)
cmd->sidemove += speed * moveEased.x;
cmd->forwardmove -= speed * moveEased.y;

if (cl.fixangle)
if (CL_InCutscene ())
return;

cl.viewangles[YAW] -= lookEased.x * joy_sensitivity_yaw.value * host_frametime;
Expand Down

0 comments on commit 749dc2a

Please sign in to comment.