mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 13:47:58 +03:00
Prevent sv_maxbots + sv_maxclients from reaching MAX_CLIENTS
This commit is contained in:
parent
d22cda594f
commit
a30f78e834
1 changed files with 9 additions and 0 deletions
|
@ -602,6 +602,15 @@ void CVAR_Init(void)
|
|||
g_rankedserver = gi.Cvar_Get("g_rankedserver", "0", 0);
|
||||
g_spectatefollow_firstperson = gi.Cvar_Get("g_spectatefollow_firstperson", "0", 0);
|
||||
|
||||
if (maxclients->integer + sv_maxbots->integer > MAX_CLIENTS) {
|
||||
unsigned int lowered;
|
||||
|
||||
lowered = MAX_CLIENTS - maxclients->integer;
|
||||
|
||||
gi.cvar_set("sv_maxbots", va("%d", lowered));
|
||||
gi.Printf("sv_maxbots reached max clients, lowering the value to %u\n", lowered);
|
||||
}
|
||||
|
||||
if (sv_numbots->integer > sv_maxbots->integer) {
|
||||
gi.Printf("numbots overflow, setting to %d\n", sv_maxbots->integer);
|
||||
gi.cvar_set("sv_numbots", sv_maxbots->string);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue