]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_world.qc
Check the player limit when getting player count to ensure forced spectators don...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_world.qc
index fce1f942d5704ab0084d74d45315bd92d894b184..c626b52f8f3b1a4d47bb11d48a60bbaeb2cf2635 100644 (file)
@@ -823,7 +823,7 @@ spawnfunc(worldspawn)
        // character set: ASCII 33-126 without the following characters: : ; ' " \ $
        if(autocvar_sv_eventlog)
        {
-               string s = sprintf("%d.%s.%06d", itos(autocvar_sv_eventlog_files_counter), strftime(false, "%s"), floor(random() * 1000000));
+               string s = sprintf("%s.%s.%06d", itos(autocvar_sv_eventlog_files_counter), strftime(false, "%s"), floor(random() * 1000000));
                matchid = strzone(s);
 
                GameLogEcho(strcat(":gamestart:", GetGametype(), "_", GetMapname(), ":", s));
@@ -1072,7 +1072,8 @@ bool MapHasRightSize(string map)
        // open map size restriction file
        string opensize_msg = strcat("opensize ", map);
        float fh = fopen(strcat("maps/", map, ".sizes"), FILE_READ);
-       int pcount = player_count;
+       int player_limit = ((autocvar_g_maplist_sizes_count_maxplayers) ? GetPlayerLimit() : 0);
+       int pcount = ((player_limit > 0) ? min(player_count, player_limit) : player_count); // bind it to the player limit so that forced spectators don't influence the limits
        if(!autocvar_g_maplist_sizes_count_bots)
                pcount -= currentbots;
        if(fh >= 0)