diff --git a/include/client/view.h b/include/client/view.h index 43e82ec05..89280a1f2 100644 --- a/include/client/view.h +++ b/include/client/view.h @@ -58,9 +58,9 @@ typedef struct viewstate_s { vec4f_t movecmd; vec4f_t velocity; vec4f_t punchangle; - float frametime; transform_t camera_transform; double time; + float frametime; float height; int weaponframe; int onground; // -1 when in air diff --git a/libs/client/cl_view.c b/libs/client/cl_view.c index b64da5cf3..76240c010 100644 --- a/libs/client/cl_view.c +++ b/libs/client/cl_view.c @@ -807,7 +807,13 @@ V_CalcRefdef (viewstate_t *vs) bob = V_CalcBob (vs); // refresh position - origin[2] += vs->height + bob; + if (vs->flags & VF_GIB) { + origin[2] += 8; // gib view height + } else if (vs->flags & VF_DEAD) { + origin[2] += -16; // corpse view height + } else { + origin[2] += vs->height + bob; + } // never let it sit exactly on a node line, because a water plane can // disappear when viewed with the eye exactly on it. diff --git a/qw/source/cl_parse.c b/qw/source/cl_parse.c index da83589df..4f279c4aa 100644 --- a/qw/source/cl_parse.c +++ b/qw/source/cl_parse.c @@ -1168,6 +1168,11 @@ CL_SetStat (int stat, int value) } cl.stats[stat] = value; cl.viewstate.weapon_model = cl_world.models.a[cl.stats[STAT_WEAPON]]; + if (cl.stdver) { + cl.viewstate.height = cl.stats[STAT_VIEWHEIGHT]; + } else { + cl.viewstate.height = DEFAULT_VIEWHEIGHT; // view height + } } static void diff --git a/qw/source/cl_screen.c b/qw/source/cl_screen.c index 8477247c6..6be96fe98 100644 --- a/qw/source/cl_screen.c +++ b/qw/source/cl_screen.c @@ -281,16 +281,6 @@ CL_UpdateScreen (double realtime) } scr_funcs_normal[0] = r_funcs->Draw_Crosshair; - if (cl.viewstate.flags & VF_GIB) { - cl.viewstate.height = 8; // gib view height - } else if (cl.viewstate.flags & VF_DEAD) { - cl.viewstate.height = -16; // corpse view height - } else { - cl.viewstate.height = DEFAULT_VIEWHEIGHT; // view height - if (cl.stdver) - cl.viewstate.height = cl.stats[STAT_VIEWHEIGHT]; - } - cl.viewstate.intermission = cl.intermission != 0; V_PrepBlend (&cl.viewstate); int seq = (cls.netchan.outgoing_sequence - 1) & UPDATE_MASK;