diff --git a/qw/include/client.h b/qw/include/client.h index 6d4ae31e3..bb9412d2c 100644 --- a/qw/include/client.h +++ b/qw/include/client.h @@ -257,6 +257,10 @@ typedef struct int viewentity; float stdver; + // serverinfo mirrors + int watervis; + int chase; + // refresh related state struct model_s *worldmodel; // cl_entitites[0].model int num_entities; // stored bottom up in cl_entities array diff --git a/qw/source/cl_cam.c b/qw/source/cl_cam.c index eadd1ac5c..b50d4e537 100644 --- a/qw/source/cl_cam.c +++ b/qw/source/cl_cam.c @@ -143,8 +143,7 @@ vlen (vec3_t v) qboolean Cam_DrawViewModel (void) { - if (atoi (Info_ValueForKey (cl.serverinfo, "chase")) - && chase_active->int_val) + if (cl.chase && chase_active->int_val) return false; if (!cl.spectator) @@ -159,8 +158,7 @@ Cam_DrawViewModel (void) qboolean Cam_DrawPlayer (int playernum) { - if (atoi (Info_ValueForKey (cl.serverinfo, "chase")) == 0 - || chase_active->int_val == 0) + if (cl.chase == 0 || chase_active->int_val == 0) return true; if (cl.spectator && autocam && locked && cl_chasecam->int_val && diff --git a/qw/source/cl_input.c b/qw/source/cl_input.c index a862507aa..ad9704bad 100644 --- a/qw/source/cl_input.c +++ b/qw/source/cl_input.c @@ -522,7 +522,7 @@ CL_BaseMove (usercmd_t *cmd) IN_Move (); // adjust for chase camera angles - if (atoi (Info_ValueForKey (cl.serverinfo, "chase")) + if (cl.chase && (chase_active->int_val == 2 || chase_active->int_val == 3)) { vec3_t dir = {0,0,0}, forward, right, up; diff --git a/qw/source/cl_main.c b/qw/source/cl_main.c index 8ca9d3752..560b61b97 100644 --- a/qw/source/cl_main.c +++ b/qw/source/cl_main.c @@ -593,6 +593,12 @@ CL_FullServerinfo_f (void) else Con_Printf ("Invalid QSG Protocol number: %s", p); } + if ((p = Info_ValueForKey (cl.serverinfo, "chase")) && *p) { + cl.chase = atof (p); + } + if ((p = Info_ValueForKey (cl.serverinfo, "watervis")) && *p) { + cl.watervis = atof (p); + } if ((p = Info_ValueForKey (cl.serverinfo, "skybox")) && *p) { //FIXME didn't actually do anything anyway } @@ -1473,7 +1479,7 @@ Host_Frame (float time) r_frametime = host_frametime; // don't allow cheats in multiplayer - if (r_active && !atoi (Info_ValueForKey (cl.serverinfo, "watervis"))) + if (r_active && !cl.watervis && r_wateralpha->value != 1.0) Cvar_SetValue (r_wateralpha, 1); CL_UpdateScreen (realtime); diff --git a/qw/source/cl_parse.c b/qw/source/cl_parse.c index ff06cff3f..d70881db7 100644 --- a/qw/source/cl_parse.c +++ b/qw/source/cl_parse.c @@ -1026,6 +1026,11 @@ CL_ServerInfo (void) Con_DPrintf ("SERVERINFO: %s=%s\n", key, value); Info_SetValueForKey (cl.serverinfo, key, value, MAX_SERVERINFO_STRING, 0); + if (strequal (key, "chase")) { + cl.chase = atoi (value); + } else if (strequal (key, "watervis")) { + cl.watervis = atoi (value); + } } void diff --git a/qw/source/cl_view.c b/qw/source/cl_view.c index 8ff9db545..e2eb87d6c 100644 --- a/qw/source/cl_view.c +++ b/qw/source/cl_view.c @@ -729,8 +729,7 @@ V_CalcRefdef (void) } else oldz = cl.simorg[2]; - if (atoi (Info_ValueForKey (cl.serverinfo, "chase")) - && chase_active->int_val) + if (cl.chase && chase_active->int_val) Chase_Update (); }