From 28c18952f84775a2542dddabe76099846e25c88d Mon Sep 17 00:00:00 2001 From: Giegue Date: Sat, 1 Apr 2023 03:03:17 -0300 Subject: [PATCH] Fix BSP reader breaking when there are too many entities. --- src/dlls/ripent.cpp | 14 +++++++------- src/dlls/ripent.h | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/dlls/ripent.cpp b/src/dlls/ripent.cpp index 09988e9..f15f9a6 100644 --- a/src/dlls/ripent.cpp +++ b/src/dlls/ripent.cpp @@ -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; diff --git a/src/dlls/ripent.h b/src/dlls/ripent.h index 83d7a46..f3baa75 100644 --- a/src/dlls/ripent.h +++ b/src/dlls/ripent.h @@ -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