diff --git a/leaderboard.lua b/leaderboard.lua index 8fdc31d..ed90b2f 100644 --- a/leaderboard.lua +++ b/leaderboard.lua @@ -12,6 +12,7 @@ local splits = {} local PATCH = nil local help = true local EncoreInitial = nil +local cv_teamchange -- Tracks if stats have been written or not local StatTrack = false @@ -1239,7 +1240,10 @@ local function think() end end - local cv_teamchange = CV_FindVar("allowteamchange") + if not cv_teamchange then + cv_teamchange = CV_FindVar("allowteamchange") + end + if p then -- Scroll controller -- Spectators can't input buttons so let the gamer do it @@ -1290,7 +1294,12 @@ local function interThink() COM_BufInsertText(server, "map " + nextMap) nextMap = nil end - if not CV_FindVar("allowteamchange").value then + + if not cv_teamchange then + cv_teamchange = CV_FindVar("allowteamchange") + end + + if not cv_teamchange.value then allowJoin(true) end end