Lua loaded records #9
@ -492,5 +492,6 @@ local function netvars(net)
|
||||
prefMode = net($)
|
||||
scrollPos = net($)
|
||||
MapRecords = net($)
|
||||
ModeSep = net($)
|
||||
end
|
||||
addHook("NetVars", netvars)
|
||||
|
@ -4,7 +4,7 @@
|
||||
-- Holds the current maps records table including all modes
|
||||
local MapRecords = {}
|
||||
|
||||
local timeFinished = 0
|
||||
local TimeFinished = 0
|
||||
local disable = false
|
||||
local prevLap = 0
|
||||
local splits = {}
|
||||
@ -699,7 +699,7 @@ COM_AddCommand("rival", findRival)
|
||||
--end
|
||||
|
||||
addHook("MapLoad", function()
|
||||
timeFinished = 0
|
||||
TimeFinished = 0
|
||||
splits = {}
|
||||
prevLap = 0
|
||||
drawState = DS_DEFAULT
|
||||
@ -1142,7 +1142,7 @@ local function saveTime(player)
|
||||
player.name,
|
||||
player.mo.skin,
|
||||
player.skincolor,
|
||||
timeFinished,
|
||||
TimeFinished,
|
||||
splits,
|
||||
Flags,
|
||||
stat_t(player.HMRs or pskin.kartspeed, player.HMRw or pskin.kartweight)
|
||||
@ -1185,14 +1185,14 @@ end
|
||||
|
||||
-- DEBUGGING
|
||||
--local function saveLeaderboard(player, ...)
|
||||
-- timeFinished = tonumber(... or player.realtime)
|
||||
-- TimeFinished = tonumber(... or player.realtime)
|
||||
-- splits = {1000, 2000, 3000}
|
||||
-- saveTime(player)
|
||||
--end
|
||||
--COM_AddCommand("save", saveLeaderboard)
|
||||
|
||||
local function regLap(player)
|
||||
if player.laps > prevLap and timeFinished == 0 then
|
||||
if player.laps > prevLap and TimeFinished == 0 then
|
||||
prevLap = player.laps
|
||||
table.insert(splits, player.realtime)
|
||||
showSplit = 5 * TICRATE
|
||||
@ -1307,8 +1307,8 @@ local function think()
|
||||
|
||||
if p then
|
||||
-- must be done before browser control
|
||||
if p.laps >= mapheaderinfo[gamemap].numlaps and timeFinished == 0 then
|
||||
timeFinished = p.realtime
|
||||
if p.laps >= mapheaderinfo[gamemap].numlaps and TimeFinished == 0 then
|
||||
TimeFinished = p.realtime
|
||||
saveTime(p)
|
||||
end
|
||||
|
||||
@ -1401,5 +1401,6 @@ local function netvars(net)
|
||||
StatTrack = net($)
|
||||
EncoreInitial = net($)
|
||||
MapRecords = net($)
|
||||
TimeFinished = net($)
|
||||
end
|
||||
addHook("NetVars", netvars)
|
||||
|
Loading…
Reference in New Issue
Block a user