void CL_ParseEntityLump(char *entdata)
{
char *data;
- char key[128], value[1024];
+ char key[128], value[4096];
char wadname[128];
int i, j, k;
FOG_clear(); // LordHavoc: no fog until set
else if (!strcmp("wad", key)) // for HalfLife maps
{
j = 0;
- for (i = 0;i < 128;i++)
+ for (i = 0;i < 4096;i++)
if (value[i] != ';' && value[i] != '\\' && value[i] != '/' && value[i] != ':')
break;
if (value[i])
{
- for (;i < 128;i++)
+ for (;i < 4096;i++)
{
// ignore path - the \\ check is for HalfLife... stupid windoze 'programmers'...
if (value[i] == '\\' || value[i] == '/' || value[i] == ':')
value[i] = 0;
strcpy(wadname, "textures/");
strcat(wadname, &value[j]);
- W_LoadTextureWadFile (wadname, FALSE);
+ W_LoadTextureWadFile (wadname, false);
j = i+1;
if (!k)
break;
int cmd;
int i;
byte cmdlog[32];
- char *cmdlogname[32];
+ char *cmdlogname[32], *temp;
int cmdindex, cmdcount = 0;
//
// 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(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)
case svc_version:
i = MSG_ReadLong ();
- if (i != PROTOCOL_VERSION && i != 250)
- Host_Error ("CL_ParseServerMessage: Server is protocol %i instead of %i\n", i, PROTOCOL_VERSION);
- Nehahrademcompatibility = i == 250;
+ if (i != PROTOCOL_VERSION && i != DPPROTOCOL_VERSION && i != 250)
+ {
+ Host_Error ("CL_ParseServerMessage: Server is protocol %i, not %i or %i", i, DPPROTOCOL_VERSION, PROTOCOL_VERSION);
+ return;
+ }
+ Nehahrademcompatibility = false;
+ if (i == 250)
+ Nehahrademcompatibility = true;
+ if (cls.demoplayback && demo_nehahra.value)
+ Nehahrademcompatibility = true;
+ dpprotocol = i == DPPROTOCOL_VERSION;
break;
case svc_disconnect:
i = MSG_ReadByte ();
if (i >= MAX_LIGHTSTYLES)
Host_Error ("svc_lightstyle > MAX_LIGHTSTYLES");
- strcpy (cl_lightstyle[i].map, MSG_ReadString());
+ strncpy (cl_lightstyle[i].map, MSG_ReadString(), MAX_STYLESTRING - 1);
+ cl_lightstyle[i].map[MAX_STYLESTRING - 1] = 0;
cl_lightstyle[i].length = strlen(cl_lightstyle[i].map);
break;
case svc_updatename:
i = MSG_ReadByte ();
if (i >= cl.maxclients)
- Host_Error ("CL_ParseServerMessage: svc_updatename > MAX_SCOREBOARD");
+ Host_Error ("CL_ParseServerMessage: svc_updatename >= MAX_SCOREBOARD");
strcpy (cl.scores[i].name, MSG_ReadString ());
break;
case svc_updatefrags:
i = MSG_ReadByte ();
if (i >= cl.maxclients)
- Host_Error ("CL_ParseServerMessage: svc_updatefrags > MAX_SCOREBOARD");
+ Host_Error ("CL_ParseServerMessage: svc_updatefrags >= MAX_SCOREBOARD");
cl.scores[i].frags = MSG_ReadShort ();
break;
case svc_updatecolors:
i = MSG_ReadByte ();
if (i >= cl.maxclients)
- Host_Error ("CL_ParseServerMessage: svc_updatecolors > MAX_SCOREBOARD");
+ Host_Error ("CL_ParseServerMessage: svc_updatecolors >= MAX_SCOREBOARD");
cl.scores[i].colors = MSG_ReadByte ();
break;
i = MSG_ReadByte ();
if (i < 0 || i >= MAX_CL_STATS)
Host_Error ("svc_updatestat: %i is invalid", i);
- cl.stats[i] = MSG_ReadLong ();;
+ cl.stats[i] = MSG_ReadLong ();
break;
case svc_spawnstaticsound: