From 36ff63a9141054bd29b18d3e932be86df3d41ad4 Mon Sep 17 00:00:00 2001 From: lordhavoc Date: Fri, 2 Mar 2001 21:40:19 +0000 Subject: [PATCH] added a new hack to make MSVC work which will definitely not break any other compilers git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@167 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_parse.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cl_parse.c b/cl_parse.c index 9dd4a916..44525d8f 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -766,7 +766,7 @@ void CL_ParseServerMessage (void) int cmd; int i; byte cmdlog[32]; - char *cmdlogname[32]; + char *cmdlogname[32], *temp; int cmdindex, cmdcount = 0; // @@ -803,7 +803,9 @@ void CL_ParseServerMessage (void) // if the high bit of the command byte is set, it is a fast update if (cmd & 128) { - cmdlogname[cmdindex] = "svc_entity"; + // LordHavoc: fix for bizarre problem in MSVC that I do not understand (if I assign the string pointer directly it ends up storing a NULL pointer) + temp = "svc_entity"; + cmdlogname[cmdindex] = temp; SHOWNET("fast update"); CL_ParseUpdate (cmd&127); continue; @@ -812,7 +814,11 @@ void CL_ParseServerMessage (void) SHOWNET(svc_strings[cmd]); cmdlogname[cmdindex] = svc_strings[cmd]; if (!cmdlogname[cmdindex]) - cmdlogname[cmdindex] = ""; + { + // LordHavoc: fix for bizarre problem in MSVC that I do not understand (if I assign the string pointer directly it ends up storing a NULL pointer) + temp = ""; + cmdlogname[cmdindex] = temp; + } // other commands switch (cmd) -- 2.39.2