From 9273b58cfd9150fa9961ba82b7abd1106b598c6f Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 21 Dec 2023 05:21:49 +0300 Subject: [PATCH 1/2] server: match sentences limit with Xash3D FWGS engine --- dlls/util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/util.h b/dlls/util.h index ad3d8002..bfe0fd32 100644 --- a/dlls/util.h +++ b/dlls/util.h @@ -498,7 +498,7 @@ extern DLL_GLOBAL int g_Language; // sentence groups #define CBSENTENCENAME_MAX 16 -#define CVOXFILESENTENCEMAX 2048 // max number of sentences in game. NOTE: this must match +#define CVOXFILESENTENCEMAX 4096 // max number of sentences in game. NOTE: this must match // CVOXFILESENTENCEMAX in engine\sound.h!!! extern char gszallsentencenames[CVOXFILESENTENCEMAX][CBSENTENCENAME_MAX]; From ecdcabfe99dd76aef98daba47aee6c6a789ac0ac Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 21 Dec 2023 05:22:12 +0300 Subject: [PATCH 2/2] server: warn mod developer about reaching the GoldSrc sentences limits --- dlls/sound.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/sound.cpp b/dlls/sound.cpp index 3dbd097a..992e0ebd 100644 --- a/dlls/sound.cpp +++ b/dlls/sound.cpp @@ -1341,6 +1341,15 @@ void SENTENCEG_Init() g_engfuncs.pfnFreeFile( pMemFile ); + if( gcallsentences >= 2048 ) + { + ALERT( at_warning, "NOTE: this mod might not work properly under GoldSource (post-anniversary update) engine: more than 2048 sentences\n" ); + } + else if( gcallsentences >= 1536 ) + { + ALERT( at_warning, "NOTE: this mod might not work properly under GoldSource (pre-anniversary update) engine: more than 1536 sentences\n" ); + } + fSentencesInit = TRUE; // init lru lists