From: LegendaryGuard Date: Tue, 3 Aug 2021 18:18:07 +0000 (+0200) Subject: Fix force join in LMS X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7d664c387e6a227cb4e199260dd64b4d956e7355;p=xonotic%2Fxonotic-data.pk3dir.git Fix force join in LMS --- diff --git a/gamemodes-server.cfg b/gamemodes-server.cfg index 77a6d735d..cf5016389 100644 --- a/gamemodes-server.cfg +++ b/gamemodes-server.cfg @@ -449,6 +449,7 @@ set g_lms_regenerate 0 set g_lms_last_join 3 "if g_lms_join_anytime is false, new players can only join if the worst active player has more than (fraglimit - g_lms_last_join) lives" set g_lms_join_anytime 1 "if true, new players can join, but get same amount of lives as the worst player" set g_lms_weaponarena "most_available" "starting weapons - takes the same options as g_weaponarena" +set g_lms_forcejoin 0 "if true, new players are forced to join in the game" // ========= diff --git a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc index dc18b7c90..27f50484b 100644 --- a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc +++ b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc @@ -10,6 +10,7 @@ int autocvar_g_lms_extra_lives; bool autocvar_g_lms_join_anytime; int autocvar_g_lms_last_join; bool autocvar_g_lms_regenerate; +bool autocvar_g_lms_forcejoin; // main functions int LMS_NewPlayerLives() @@ -267,11 +268,12 @@ MUTATOR_HOOKFUNCTION(lms, ClientConnect) } } -// FIXME LMS doesn't allow clients to spectate due to its particular implementation +// LMS doesn't allow clients to spectate due to its particular implementation MUTATOR_HOOKFUNCTION(lms, AutoJoinOnConnection) { - if(autocvar_g_campaign) + if(autocvar_g_campaign || !autocvar_g_lms_forcejoin) return false; + return true; }