g_maxGameClients is supposed to limit the number of currently connected clients who are allowed to play. But apparently it was unimplemented.
I found a reference in a comment somewhere indicating there should also be a queue so the game knows who should play next after one of the players leaves. I didn't bother with that though. I just compare g_maxGameClients vs. level.numPlayingClients in G_Team_f.
People with ADMF_FORCETEAMCHANGE can join teams even if too many people are currently playing, and g_maxGameClients has no effect on !putteam. I also changed it so that g_maxGameClients can be changed in game (might be useful for tournament organization).
I think the calculating of level.num*Clients is buggy and will lead to problems with this patch (I intend to submit a patch to fix that).
Created attachment 1208[details]
only if spectating
I just realized my patch doesn't check if they are a spectator first. If they want to switch teams and there are too many people playing, so be it.
Created attachment 1204 [details] g_maxGameClients
Created attachment 1208 [details] only if spectating I just realized my patch doesn't check if they are a spectator first. If they want to switch teams and there are too many people playing, so be it.