From a0f49816e580c364d252bc6e0cdec553895f777a Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 6 Oct 2002 04:30:50 +0000 Subject: [PATCH] cl_parse.c: print the name of the last svc parsed when a badread happens sv_ents.c: allocate enough space for the svc_nails2 nails --- qw/source/cl_parse.c | 5 +++-- qw/source/sv_ents.c | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/qw/source/cl_parse.c b/qw/source/cl_parse.c index 9bb783659..3d8c19257 100644 --- a/qw/source/cl_parse.c +++ b/qw/source/cl_parse.c @@ -1201,7 +1201,7 @@ CL_ParseServerMessage (void) { const char *s; static dstring_t *stuffbuf; - int cmd, i, j; + int cmd = 0, i, j; received_framecount = host_framecount; cl.last_servermessage = realtime; @@ -1218,7 +1218,8 @@ CL_ParseServerMessage (void) // parse the message while (1) { if (net_message->badread) { - Host_Error ("CL_ParseServerMessage: Bad server message"); + Host_Error ("CL_ParseServerMessage: Bad server message: %s\n", + svc_strings[cmd]); break; } diff --git a/qw/source/sv_ents.c b/qw/source/sv_ents.c index 7911bb296..df74f73b5 100644 --- a/qw/source/sv_ents.c +++ b/qw/source/sv_ents.c @@ -131,12 +131,13 @@ SV_EmitNailUpdate (sizebuf_t *msg, qboolean recorder) { byte *buf; // [48 bits] xyzpy 12 12 12 4 8 int n, p, x, y, z, yaw; + int bpn = recorder ? 7 : 6; // bytes per nail edict_t *ent; if (!numnails) return; - buf = SZ_GetSpace (msg, numnails * 6 + 2); + buf = SZ_GetSpace (msg, numnails * bpn + 2); *buf++ = recorder ? svc_nails2 : svc_nails; *buf++ = numnails;