Only change the maxclients when the map is different

It fixes an issue where on restart, only the number of snapshot entities was changed without the memory being reallocated for it
This commit is contained in:
smallmodel 2024-10-18 20:26:27 +02:00 committed by GitHub
parent 6d69a8033f
commit 6a107419e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -613,7 +613,11 @@ void SV_SpawnServer( const char *server, qboolean loadgame, qboolean restart, qb
differentmap = qfalse;
}
if( sv_maxclients->modified ) {
if( sv_maxclients->modified
&& differentmap // Fixed in OPM
// OG doesn't check for different map when changing the max clients
// which means the snapshot entities memory isn't reallocated
) {
SV_ChangeMaxClients();
}
}
@ -623,6 +627,7 @@ void SV_SpawnServer( const char *server, qboolean loadgame, qboolean restart, qb
SV_Startup();
}
// Added in 2.0
SV_InitRadar();
sv.restarting = ( keep_scripts || !differentmap );