diff --git a/qw/include/client.h b/qw/include/client.h index 8f4c52bb0..3bf62a8a7 100644 --- a/qw/include/client.h +++ b/qw/include/client.h @@ -261,6 +261,7 @@ typedef struct // serverinfo mirrors int chase; + int sv_cshifts; int no_pogo_stick; int teamplay; int watervis; diff --git a/qw/source/cl_main.c b/qw/source/cl_main.c index 32d2835c0..e218605ff 100644 --- a/qw/source/cl_main.c +++ b/qw/source/cl_main.c @@ -596,17 +596,22 @@ CL_FullServerinfo_f (void) else Con_Printf ("Invalid QSG Protocol number: %s", p); } + + cl.chase = cl.sv_cshifts = cl.no_pogo_stick = cl.teamplay = 0; if ((p = Info_ValueForKey (cl.serverinfo, "chase")) && *p) { - cl.chase = atof (p); + cl.chase = atoi (p); + } + if ((p = Info_ValueForKey (cl.serverinfo, "cshifts")) && *p) { + cl.sv_cshifts = atoi (p); } if ((p = Info_ValueForKey (cl.serverinfo, "no_pogo_stick")) && *p) { - cl.no_pogo_stick = atof (p); + cl.no_pogo_stick = atoi (p); } if ((p = Info_ValueForKey (cl.serverinfo, "teamplay")) && *p) { - cl.teamplay = atof (p); + cl.teamplay = atoi (p); } if ((p = Info_ValueForKey (cl.serverinfo, "watervis")) && *p) { - cl.watervis = atof (p); + cl.watervis = atoi (p); } if ((p = Info_ValueForKey (cl.serverinfo, "skybox")) && *p) { //FIXME didn't actually do anything anyway @@ -1453,7 +1458,7 @@ Host_Frame (float time) // fetch results from server CL_ReadPackets (); - if (cl.no_pogo_stick) + if (cl.no_pogo_stick && !no_pogo_stick->int_val) Cvar_Set (no_pogo_stick, "1"); // send intentions now diff --git a/qw/source/cl_parse.c b/qw/source/cl_parse.c index 7c35d945e..28aba8d8a 100644 --- a/qw/source/cl_parse.c +++ b/qw/source/cl_parse.c @@ -1041,6 +1041,12 @@ CL_ServerInfo (void) Info_SetValueForKey (cl.serverinfo, key, value, 0); if (strequal (key, "chase")) { cl.chase = atoi (value); + } else if (strequal (key, "cshifts")) { + cl.sv_cshifts = atoi (value); + } else if (strequal (key, "no_pogo_stick")) { + cl.no_pogo_stick = atoi (value); + } else if (strequal (key, "teamplay")) { + cl.teamplay = atoi (value); } else if (strequal (key, "watervis")) { cl.watervis = atoi (value); } diff --git a/qw/source/cl_view.c b/qw/source/cl_view.c index 6287d1406..053a355b5 100644 --- a/qw/source/cl_view.c +++ b/qw/source/cl_view.c @@ -258,8 +258,7 @@ V_ParseDamage (void) cl.faceanimtime = cl.time + 0.2; // but sbar face into pain frame if (cl_cshift_damage->int_val - || (atoi (Info_ValueForKey (cl.serverinfo, "cshifts")) & - INFO_CSHIFT_DAMAGE)) { + || (cl.sv_cshifts & INFO_CSHIFT_DAMAGE)) { cl.cshifts[CSHIFT_DAMAGE].percent += 3 * count; cl.cshifts[CSHIFT_DAMAGE].percent = @@ -313,8 +312,7 @@ void V_BonusFlash_f (void) { if (!cl_cshift_bonus->int_val - && !(atoi (Info_ValueForKey (cl.serverinfo, "cshifts")) & - INFO_CSHIFT_BONUS)) + && !(cl.sv_cshifts & INFO_CSHIFT_BONUS)) return; cl.cshifts[CSHIFT_BONUS].destcolor[0] = 215; @@ -332,8 +330,7 @@ void V_SetContentsColor (int contents) { if (!cl_cshift_contents->int_val - && !(atoi (Info_ValueForKey (cl.serverinfo, "cshifts")) & - INFO_CSHIFT_CONTENTS)) { + && !(cl.sv_cshifts & INFO_CSHIFT_CONTENTS)) { cl.cshifts[CSHIFT_CONTENTS] = cshift_empty; return; } @@ -443,8 +440,7 @@ V_PrepBlend (void) int i, j; if (cl_cshift_powerup->int_val - || (atoi (Info_ValueForKey (cl.serverinfo, "cshifts")) - & INFO_CSHIFT_POWERUP)) + || (cl.sv_cshifts & INFO_CSHIFT_POWERUP)) V_CalcPowerupCshift (); vid.cshift_changed = false;