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

This commit is contained in:
mittorn 2019-11-02 12:46:11 +07:00
parent a1db6c6a9b
commit d6f8112860
3 changed files with 4 additions and 2 deletions

View File

@ -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 );

View File

@ -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 )

View File

@ -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