diff --git a/leaderboard.lua b/leaderboard.lua index babf280..9d3129f 100644 --- a/leaderboard.lua +++ b/leaderboard.lua @@ -310,22 +310,25 @@ function allowJoin(v) end end -local function ingame() +local function 2PlusInGame() local n = 0 for p in players.iterate do if p.valid and not p.spectator then n = $ + 1 + if n == 2 then + return true + end end end - return n + return false end local function initLeaderboard(player) if cv_enable.value and G_RaceGametype() then if disable and leveltime < START_TIME then - disable = ingame() > 1 + disable = 2PlusInGame() else - disable = $ or ingame() > 1 + disable = $ or 2PlusInGame() end else disable = true @@ -342,7 +345,7 @@ end addHook("PlayerSpawn", initLeaderboard) local function doyoudare(player) - if ingame() > 1 or player.spectator then + if 2PlusInGame() or player.spectator then CONS_Printf(player, "How dare you") return false end @@ -1163,7 +1166,7 @@ local function think() if disable then if AntiAFK then - if ingame() > 1 then + if 2PlusInGame() then for p in players.iterate do if p.valid and not p.spectator and not p.exiting and p.lives > 0 then if p.cmd.buttons then