set g_lms_join_anytime 1 "1: new players can join, but get same amount of lives as the worst player; 0: new players can only join if the worst active player has (fraglimit - g_lms_last_join) or more lives"
set g_lms_items 0 "enables items to spawn, weaponarena still disables weapons and ammo (to force all items to spawn, use g_pickup_items 1 instead)"
set g_lms_weaponarena "most_available" "starting weapons - takes the same options as g_weaponarena"
+set g_lms_forfeit_min_match_time 30 "end the match early if at least this many seconds have elapsed and less than 2 players are playing due to forfeits"
// =========
#include <server/items/items.qh>
int autocvar_g_lms_extra_lives;
+float autocvar_g_lms_forfeit_min_match_time;
bool autocvar_g_lms_join_anytime;
int autocvar_g_lms_last_join;
bool autocvar_g_lms_items;
entity first_player = NULL;
int totalplayers = 0;
- FOREACH_CLIENT(IS_PLAYER(it) && it.frags == FRAGS_PLAYER, {
- if (!totalplayers)
- first_player = it;
- ++totalplayers;
+ int totalplayed = 0;
+ FOREACH_CLIENT(true, {
+ if (IS_PLAYER(it) && it.frags == FRAGS_PLAYER)
+ {
+ if (!totalplayers)
+ first_player = it;
+ ++totalplayers;
+ }
+ else if (GameRules_scoring_add(it, LMS_RANK, 0))
+ ++totalplayed;
});
if (totalplayers)
if (LMS_NewPlayerLives())
{
+ if (totalplayed && game_starttime > 0 && time > game_starttime + autocvar_g_lms_forfeit_min_match_time) // give players time to join
+ {
+ GameRules_scoring_add(first_player, LMS_RANK, 1);
+ return WINNING_YES;
+ }
// game still running (that is, nobody got removed from the game by a frag yet)? then continue
return WINNING_NO;
}
// nobody is playing at all...
if (LMS_NewPlayerLives())
{
+ if (totalplayed && game_starttime > 0 && time > game_starttime + autocvar_g_lms_forfeit_min_match_time) // give players time to join
+ {
+ ClearWinners();
+ return WINNING_YES;
+ }
// wait for players...
}
else