forked from Not/srb2k-leaderboard
only look for scoreTable once
This commit is contained in:
parent
14f8769d93
commit
23a8373230
@ -13,6 +13,7 @@ local PATCH = nil
|
|||||||
local help = true
|
local help = true
|
||||||
local EncoreInitial = nil
|
local EncoreInitial = nil
|
||||||
local cv_teamchange
|
local cv_teamchange
|
||||||
|
local scoreTable
|
||||||
|
|
||||||
-- Tracks if stats have been written or not
|
-- Tracks if stats have been written or not
|
||||||
local StatTrack = false
|
local StatTrack = false
|
||||||
@ -240,7 +241,7 @@ if f then
|
|||||||
flags = tonumber(t[7])
|
flags = tonumber(t[7])
|
||||||
end
|
end
|
||||||
|
|
||||||
local scoreTable = getScoreTable(tonumber(t[1]), flags) or {}
|
scoreTable = getScoreTable(tonumber(t[1]), flags) or {}
|
||||||
|
|
||||||
local spl = {}
|
local spl = {}
|
||||||
if t[6] != nil then
|
if t[6] != nil then
|
||||||
@ -962,8 +963,6 @@ local function drawScoreboard(v, player)
|
|||||||
|
|
||||||
cachePatches(v)
|
cachePatches(v)
|
||||||
|
|
||||||
local scoreTable = getScoreTable(gamemap, Flags)
|
|
||||||
|
|
||||||
local gui = cv_gui.value
|
local gui = cv_gui.value
|
||||||
if leveltime < START_TIME or player.exiting or player.lives == 0 then
|
if leveltime < START_TIME or player.exiting or player.lives == 0 then
|
||||||
gui = GUI_ON
|
gui = GUI_ON
|
||||||
@ -1010,7 +1009,7 @@ end
|
|||||||
|
|
||||||
-- Find location of player and scroll to it
|
-- Find location of player and scroll to it
|
||||||
function scroll_to(player)
|
function scroll_to(player)
|
||||||
local m = getScoreTable(gamemap, Flags) or {}
|
local m = scoreTable or {}
|
||||||
|
|
||||||
scrollToPos = 2
|
scrollToPos = 2
|
||||||
for pos, score in ipairs(m) do
|
for pos, score in ipairs(m) do
|
||||||
@ -1039,7 +1038,8 @@ local function writeStats()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function saveTime(player)
|
local function saveTime(player)
|
||||||
local scoreTable = getScoreTable(gamemap, Flags) or {}
|
|
||||||
|
scoreTable = $ or {}
|
||||||
|
|
||||||
local pskin = skins[player.mo.skin]
|
local pskin = skins[player.mo.skin]
|
||||||
local newscore = score_t(
|
local newscore = score_t(
|
||||||
@ -1242,6 +1242,8 @@ local function think()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scoreTable = getScoreTable(gamemap, Flags)
|
||||||
|
|
||||||
if not cv_teamchange then
|
if not cv_teamchange then
|
||||||
cv_teamchange = CV_FindVar("allowteamchange")
|
cv_teamchange = CV_FindVar("allowteamchange")
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user