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) 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; return NULL;
} }
e->key = copystring(token); e->key = copystring(token);
GetToken(false); GetToken(false);
if (strlen(token) >= MAX_VALUE - 1) 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; return NULL;
} }
e->value = copystring(token); e->value = copystring(token);
@@ -315,7 +315,7 @@ bool EndOfScript(bool crossline)
{ {
if (!crossline) if (!crossline)
{ {
LOG_MESSAGE(PLID, "Line %i is incomplete\n", scriptline); LOG_MESSAGE(PLID, "Line %i is incomplete", scriptline);
return false; return false;
} }
@@ -382,7 +382,7 @@ skipspace:
{ {
if (!crossline) if (!crossline)
{ {
LOG_MESSAGE(PLID, "Line %i is incomplete\n", scriptline); LOG_MESSAGE(PLID, "Line %i is incomplete", scriptline);
return false; return false;
} }
scriptline = script->line++; scriptline = script->line++;
@@ -397,7 +397,7 @@ skipspace:
{ {
if (!crossline) if (!crossline)
{ {
LOG_MESSAGE(PLID, "Line %i is incomplete\n", scriptline); LOG_MESSAGE(PLID, "Line %i is incomplete", scriptline);
return false; return false;
} }
while (*script->script_p++ != '\n') while (*script->script_p++ != '\n')
@@ -421,7 +421,7 @@ skipspace:
if (script->script_p == script->end_p) if (script->script_p == script->end_p)
break; break;
if (token_p == &token[MAXTOKEN]) 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++; script->script_p++;
} }
@@ -432,7 +432,7 @@ skipspace:
if (script->script_p == script->end_p) if (script->script_p == script->end_p)
break; break;
if (token_p == &token[MAXTOKEN]) 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; *token_p = 0;

View File

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