From fe6f65306c234a7b285f625b343d95f34c03ad23 Mon Sep 17 00:00:00 2001 From: Shpoike Date: Sat, 6 Mar 2021 06:25:24 +0000 Subject: [PATCH] Try to improve robustness when playing nehahra. --- Quake/cl_parse.c | 16 ++++++++++++++-- Quake/protocol.h | 3 +++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Quake/cl_parse.c b/Quake/cl_parse.c index 4123e2a4..ff287298 100644 --- a/Quake/cl_parse.c +++ b/Quake/cl_parse.c @@ -71,8 +71,8 @@ const char *svc_strings[128] = "svc_sellscreen", "svc_cutscene", //johnfitz -- new server messages - "35", // 35 - "36", // 36 + "svc_showpic_dp", // 35 + "svc_hidepic_dp", // 36 "svc_skybox_fitz", // 37 // [string] skyname "38", // 38 "39", // 39 @@ -2704,6 +2704,18 @@ void CL_ParseServerMessage (void) break; #endif + //these two are used by nehahra. we ignore them, parsing only to avoid crashing. + case svcdp_showpic: + /*slotname = */MSG_ReadString(); + /*imagename = */MSG_ReadString(); + /*x = */MSG_ReadByte(); //FIXME: nehahra uses bytes, but DP uses shorts for other games. just use csqc instead. + /*y = */MSG_ReadByte(); + Con_DPrintf("Ignoring svcdp_showpic\n"); + break; + case svcdp_hidepic: + /*slotname = */MSG_ReadString(); + Con_DPrintf("Ignoring svcdp_hidepic\n"); + break; case svcdp_effect: case svcdp_effect2: //these are kinda pointless when the particle system can do it diff --git a/Quake/protocol.h b/Quake/protocol.h index faa9dc1a..f016aea1 100644 --- a/Quake/protocol.h +++ b/Quake/protocol.h @@ -297,6 +297,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define svc_sellscreen 33 #define svc_cutscene 34 +#define svcdp_showpic 35 // [string] slot [string] img, [byte] x, [byte] y. purely for nehahra... only relative to top-left, so not very useful. use csqc instead. +#define svcdp_hidepic 36 // [string] slot + //johnfitz -- PROTOCOL_FITZQUAKE -- new server messages #define svc_skybox 37 // [string] name #define svc_bf 40