Fix BSP reader breaking when there are too many entities.

This commit is contained in:
Giegue
2023-04-01 03:03:17 -03:00
parent 18268776ae
commit 28c18952f8
2 changed files with 10 additions and 10 deletions

View File

@@ -104,14 +104,14 @@ epair_t *ParseEpair(void)
if (strlen(token) >= MAX_KEY - 1)
{
LOG_MESSAGE(PLID, "ParseEpar: token too long [strlen(token) >= MAX_KEY - 1]");
LOG_MESSAGE(PLID, "ParseEpar: token key too long");
return NULL;
}
e->key = copystring(token);
GetToken(false);
if (strlen(token) >= MAX_VALUE - 1)
{
LOG_MESSAGE(PLID, "ParseEpar: token too long [strlen(token) >= MAX_VALUE - 1]");
LOG_MESSAGE(PLID, "ParseEpar: token value too long");
return NULL;
}
e->value = copystring(token);
@@ -315,7 +315,7 @@ bool EndOfScript(bool crossline)
{
if (!crossline)
{
LOG_MESSAGE(PLID, "Line %i is incomplete\n", scriptline);
LOG_MESSAGE(PLID, "Line %i is incomplete", scriptline);
return false;
}
@@ -382,7 +382,7 @@ skipspace:
{
if (!crossline)
{
LOG_MESSAGE(PLID, "Line %i is incomplete\n", scriptline);
LOG_MESSAGE(PLID, "Line %i is incomplete", scriptline);
return false;
}
scriptline = script->line++;
@@ -397,7 +397,7 @@ skipspace:
{
if (!crossline)
{
LOG_MESSAGE(PLID, "Line %i is incomplete\n", scriptline);
LOG_MESSAGE(PLID, "Line %i is incomplete", scriptline);
return false;
}
while (*script->script_p++ != '\n')
@@ -421,7 +421,7 @@ skipspace:
if (script->script_p == script->end_p)
break;
if (token_p == &token[MAXTOKEN])
LOG_MESSAGE(PLID, "Token too large on line %i\n", scriptline);
LOG_MESSAGE(PLID, "Token too large on line %i", scriptline);
}
script->script_p++;
}
@@ -432,7 +432,7 @@ skipspace:
if (script->script_p == script->end_p)
break;
if (token_p == &token[MAXTOKEN])
LOG_MESSAGE(PLID, "Token too large on line %i\n", scriptline);
LOG_MESSAGE(PLID, "Token too large on line %i", scriptline);
}
*token_p = 0;

View File

@@ -14,9 +14,9 @@
#include "extdll.h"
// upper design bounds
#define MAX_MAP_ENTITIES 1024
#define MAX_MAP_ENTSTRING (128*1024)
// some ents are info holders for compiler tools (also -num_edicts is customizable)
#define MAX_MAP_ENTITIES 2048
#define MAX_MAP_ENTSTRING (128*2048)
// key / value pair sizes