From d6f811286088880f799b3cc6391786c5e1490ef5 Mon Sep 17 00:00:00 2001 From: mittorn Date: Sat, 2 Nov 2019 12:46:11 +0700 Subject: [PATCH] gameinfo: add MIN_EDICTS constant instead of magic number 600, low it to 64 --- engine/client/cl_parse.c | 2 +- engine/common/filesystem.c | 2 +- engine/common/protocol.h | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index a82db957..5fed0b8c 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -881,7 +881,7 @@ void CL_ParseServerData( sizebuf_t *msg ) cl.playernum = MSG_ReadByte( msg ); cl.maxclients = MSG_ReadByte( msg ); clgame.maxEntities = MSG_ReadWord( msg ); - clgame.maxEntities = bound( 30, clgame.maxEntities, MAX_EDICTS ); + clgame.maxEntities = bound( MIN_EDICTS, clgame.maxEntities, MAX_EDICTS ); clgame.maxModels = MSG_ReadWord( msg ); Q_strncpy( clgame.mapname, MSG_ReadString( msg ), MAX_STRING ); Q_strncpy( clgame.maptitle, MSG_ReadString( msg ), MAX_STRING ); diff --git a/engine/common/filesystem.c b/engine/common/filesystem.c index aaf60591..0eaacbb3 100644 --- a/engine/common/filesystem.c +++ b/engine/common/filesystem.c @@ -1588,7 +1588,7 @@ void FS_ParseGenericGameInfo( gameinfo_t *GameInfo, const char *buf, const qbool else if( !Q_stricmp( token, isGameInfo ? "max_edicts" : "edicts" )) { pfile = COM_ParseFile( pfile, token ); - GameInfo->max_edicts = bound( 600, Q_atoi( token ), MAX_EDICTS ); + GameInfo->max_edicts = bound( MIN_EDICTS, Q_atoi( token ), MAX_EDICTS ); } // only for gameinfo else if( isGameInfo ) diff --git a/engine/common/protocol.h b/engine/common/protocol.h index fe30eaec..404fabbb 100644 --- a/engine/common/protocol.h +++ b/engine/common/protocol.h @@ -126,6 +126,8 @@ GNU General Public License for more details. #define MAX_EDICTS_BYTES ((MAX_EDICTS + 7) / 8) #define LAST_EDICT (MAX_EDICTS - 1) +#define MIN_EDICTS 64 + #define MAX_CUSTOM_BITS 10 #define MAX_CUSTOM (1<