]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_parse.c
added a new hack to make MSVC work which will definitely not break any other compilers
[xonotic/darkplaces.git] / cl_parse.c
index 9dd4a9163891457ed0adaa93b77cf43f41e05165..44525d8ffc2c6cf47a5ab9531520fa6ffd2b1add 100644 (file)
@@ -766,7 +766,7 @@ void CL_ParseServerMessage (void)
        int                     cmd;
        int                     i;
        byte            cmdlog[32];
        int                     cmd;
        int                     i;
        byte            cmdlog[32];
-       char            *cmdlogname[32];
+       char            *cmdlogname[32], *temp;
        int                     cmdindex, cmdcount = 0;
        
 //
        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)
                {
                // 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;
                        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])
                SHOWNET(svc_strings[cmd]);
                cmdlogname[cmdindex] = svc_strings[cmd];
                if (!cmdlogname[cmdindex])
-                       cmdlogname[cmdindex] = "<unknown>";
+               {
+                       // 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 = "<unknown>";
+                       cmdlogname[cmdindex] = temp;
+               }
        
                // other commands
                switch (cmd)
        
                // other commands
                switch (cmd)