mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 14:20:59 +00:00
[client] Finish moving onground to viewstate
Missed this in the entity cleanup (really, should have been separate commits, but oh well).
This commit is contained in:
parent
82e58dae5f
commit
5cf1da7c25
7 changed files with 9 additions and 11 deletions
|
@ -43,7 +43,7 @@ typedef struct viewstate_s {
|
||||||
vec4f_t origin;
|
vec4f_t origin;
|
||||||
vec3_t angles;
|
vec3_t angles;
|
||||||
int weaponframe;
|
int weaponframe;
|
||||||
int onground;
|
int onground; // -1 when in air
|
||||||
uint32_t flags;
|
uint32_t flags;
|
||||||
float frametime;
|
float frametime;
|
||||||
vec4f_t punchangle;
|
vec4f_t punchangle;
|
||||||
|
|
|
@ -178,7 +178,6 @@ typedef struct {
|
||||||
double laststop;
|
double laststop;
|
||||||
|
|
||||||
qboolean paused; // Sent over by server
|
qboolean paused; // Sent over by server
|
||||||
int onground;
|
|
||||||
float viewheight;
|
float viewheight;
|
||||||
float crouch; // Local amount for smoothing stepups
|
float crouch; // Local amount for smoothing stepups
|
||||||
qboolean inwater;
|
qboolean inwater;
|
||||||
|
|
|
@ -692,7 +692,7 @@ CL_ParseClientdata (void)
|
||||||
cl.stats[STAT_ITEMS] = i;
|
cl.stats[STAT_ITEMS] = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
cl.onground = (bits & SU_ONGROUND) ? 0 : -1;
|
cl.viewstate.onground = (bits & SU_ONGROUND) ? 0 : -1;
|
||||||
cl.inwater = (bits & SU_INWATER) != 0;
|
cl.inwater = (bits & SU_INWATER) != 0;
|
||||||
|
|
||||||
if (bits & SU_WEAPONFRAME)
|
if (bits & SU_WEAPONFRAME)
|
||||||
|
@ -851,7 +851,7 @@ CL_ParseServerMessage (void)
|
||||||
else if (cl_shownet->int_val == 2)
|
else if (cl_shownet->int_val == 2)
|
||||||
Sys_Printf ("------------------\n");
|
Sys_Printf ("------------------\n");
|
||||||
|
|
||||||
cl.onground = -1; // unless the server says otherwise
|
cl.viewstate.onground = -1; // unless the server says otherwise
|
||||||
|
|
||||||
// parse the message
|
// parse the message
|
||||||
MSG_BeginReading (net_message);
|
MSG_BeginReading (net_message);
|
||||||
|
|
|
@ -124,7 +124,7 @@ V_CalcBob (void)
|
||||||
if (cl.spectator)
|
if (cl.spectator)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (cl.onground == -1)
|
if (cl.viewstate.onground == -1)
|
||||||
return bob; // just use old value
|
return bob; // just use old value
|
||||||
|
|
||||||
bobtime += cl.viewstate.frametime;
|
bobtime += cl.viewstate.frametime;
|
||||||
|
@ -666,7 +666,7 @@ V_CalcRefdef (void)
|
||||||
r_data->refdef->viewrotation);
|
r_data->refdef->viewrotation);
|
||||||
|
|
||||||
// smooth out stair step ups
|
// smooth out stair step ups
|
||||||
if ((cl.onground != -1) && (origin[2] - oldz > 0)) {
|
if ((cl.viewstate.onground != -1) && (origin[2] - oldz > 0)) {
|
||||||
float steptime;
|
float steptime;
|
||||||
|
|
||||||
steptime = cl.viewstate.frametime;
|
steptime = cl.viewstate.frametime;
|
||||||
|
|
|
@ -232,7 +232,6 @@ typedef struct {
|
||||||
double laststop;
|
double laststop;
|
||||||
|
|
||||||
qboolean paused; // Sent over by server
|
qboolean paused; // Sent over by server
|
||||||
int onground; // -1 when in air
|
|
||||||
float viewheight;
|
float viewheight;
|
||||||
float crouch; // local amount for smoothing stepups
|
float crouch; // local amount for smoothing stepups
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,7 @@ CL_PredictMove (void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// assume on ground unless prediction says different
|
// assume on ground unless prediction says different
|
||||||
cl.onground = 0;
|
cl.viewstate.onground = 0;
|
||||||
|
|
||||||
cl.time = realtime - cls.latency - cl_pushlatency->value * 0.001;
|
cl.time = realtime - cls.latency - cl_pushlatency->value * 0.001;
|
||||||
if (cl.time > realtime)
|
if (cl.time > realtime)
|
||||||
|
@ -157,7 +157,7 @@ CL_PredictMove (void)
|
||||||
CL_PredictUsercmd (&from->playerstate[cl.playernum],
|
CL_PredictUsercmd (&from->playerstate[cl.playernum],
|
||||||
&to->playerstate[cl.playernum], &to->cmd,
|
&to->playerstate[cl.playernum], &to->cmd,
|
||||||
true);
|
true);
|
||||||
cl.onground = onground;
|
cl.viewstate.onground = onground;
|
||||||
if (to->senttime >= cl.time)
|
if (to->senttime >= cl.time)
|
||||||
break;
|
break;
|
||||||
from = to;
|
from = to;
|
||||||
|
|
|
@ -126,7 +126,7 @@ V_CalcBob (void)
|
||||||
if (cl.spectator)
|
if (cl.spectator)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (cl.onground == -1)
|
if (cl.viewstate.onground == -1)
|
||||||
return bob; // just use old value
|
return bob; // just use old value
|
||||||
|
|
||||||
bobtime += cl.viewstate.frametime;
|
bobtime += cl.viewstate.frametime;
|
||||||
|
@ -672,7 +672,7 @@ V_CalcRefdef (void)
|
||||||
r_data->refdef->viewrotation);
|
r_data->refdef->viewrotation);
|
||||||
|
|
||||||
// smooth out stair step ups
|
// smooth out stair step ups
|
||||||
if ((cl.onground != -1) && (origin[2] - oldz > 0)) {
|
if ((cl.viewstate.onground != -1) && (origin[2] - oldz > 0)) {
|
||||||
float steptime;
|
float steptime;
|
||||||
|
|
||||||
steptime = cl.viewstate.frametime;
|
steptime = cl.viewstate.frametime;
|
||||||
|
|
Loading…
Reference in a new issue