forked from Not/srb2k-leaderboard
restore kartencore to initial value
This commit is contained in:
parent
1ab596ebeb
commit
a1989d319b
@ -11,6 +11,7 @@ local prevLap = 0
|
|||||||
local splits = {}
|
local splits = {}
|
||||||
local PATCH = nil
|
local PATCH = nil
|
||||||
local help = true
|
local help = true
|
||||||
|
local EncoreInitial = nil
|
||||||
|
|
||||||
-- Tracks if stats have been written or not
|
-- Tracks if stats have been written or not
|
||||||
local StatTrack = false
|
local StatTrack = false
|
||||||
@ -310,6 +311,13 @@ local function initLeaderboard(player)
|
|||||||
disable = disable or ingame() > 1
|
disable = disable or ingame() > 1
|
||||||
end
|
end
|
||||||
disable = $ or not cv_enable.value
|
disable = $ or not cv_enable.value
|
||||||
|
|
||||||
|
-- Restore encore mode to initial value
|
||||||
|
if disable and EncoreInitial != nil then
|
||||||
|
COM_BufInsertText(server, string.format("kartencore %d", EncoreInitial))
|
||||||
|
EncoreInitial = nil
|
||||||
|
end
|
||||||
|
|
||||||
player.afkTime = leveltime
|
player.afkTime = leveltime
|
||||||
end
|
end
|
||||||
addHook("PlayerSpawn", initLeaderboard)
|
addHook("PlayerSpawn", initLeaderboard)
|
||||||
@ -426,6 +434,10 @@ local function toggleEncore(player)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local enc = CV_FindVar("kartencore")
|
local enc = CV_FindVar("kartencore")
|
||||||
|
if EncoreInitial == nil then
|
||||||
|
EncoreInitial = enc.value
|
||||||
|
end
|
||||||
|
|
||||||
if enc.value then
|
if enc.value then
|
||||||
COM_BufInsertText(server, "kartencore off")
|
COM_BufInsertText(server, "kartencore off")
|
||||||
else
|
else
|
||||||
@ -1246,6 +1258,7 @@ local function netvars(net)
|
|||||||
prevLap = net($)
|
prevLap = net($)
|
||||||
drawState = net($)
|
drawState = net($)
|
||||||
StatTrack = net($)
|
StatTrack = net($)
|
||||||
|
EncoreInitial = net($)
|
||||||
lb = net($)
|
lb = net($)
|
||||||
end
|
end
|
||||||
addHook("NetVars", netvars)
|
addHook("NetVars", netvars)
|
||||||
|
Loading…
Reference in New Issue
Block a user