Browse Source

gameinfo: add MIN_EDICTS constant instead of magic number 600, low it to 64

pull/2/head
mittorn 5 years ago
parent
commit
d6f8112860
  1. 2
      engine/client/cl_parse.c
  2. 2
      engine/common/filesystem.c
  3. 2
      engine/common/protocol.h

2
engine/client/cl_parse.c

@ -881,7 +881,7 @@ void CL_ParseServerData( sizebuf_t *msg ) @@ -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 );

2
engine/common/filesystem.c

@ -1588,7 +1588,7 @@ void FS_ParseGenericGameInfo( gameinfo_t *GameInfo, const char *buf, const qbool @@ -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 )

2
engine/common/protocol.h

@ -126,6 +126,8 @@ GNU General Public License for more details. @@ -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<<MAX_CUSTOM_BITS)// 10 bits == 1024 generic file
#define MAX_USER_MESSAGES 197 // another 58 messages reserved for engine routines

Loading…
Cancel
Save