Compare commits
3 Commits
v1.2.20
...
lonsfor-pa
Author | SHA1 | Date | |
---|---|---|---|
518e9f7893 | |||
a840a5fa83 | |||
bd5e3f24c6 |
@ -12,7 +12,6 @@ local splits = {}
|
||||
local PATCH = nil
|
||||
local help = true
|
||||
local EncoreInitial = nil
|
||||
local cv_teamchange
|
||||
local scoreTable
|
||||
|
||||
|
||||
@ -91,6 +90,10 @@ local ticsToTime
|
||||
local allowJoin
|
||||
---------------
|
||||
|
||||
-- cvars
|
||||
local cv_teamchange
|
||||
local cv_spbatk
|
||||
|
||||
local cv_gui = CV_RegisterVar({
|
||||
name = "lb_gui",
|
||||
defaultvalue = GUI_ON,
|
||||
@ -254,8 +257,9 @@ local function stat_str(stat)
|
||||
end
|
||||
|
||||
-- Read the leaderboard
|
||||
local f = io.open(FILENAME, "r")
|
||||
if f then
|
||||
if isserver then
|
||||
local f = io.open(FILENAME, "r")
|
||||
if f then
|
||||
for l in f:lines() do
|
||||
-- Leaderboard is stored in the following tab separated format
|
||||
-- mapnum, name, skin, color, time, splits, flags, stat
|
||||
@ -306,8 +310,9 @@ if f then
|
||||
|
||||
sortScores()
|
||||
f:close()
|
||||
else
|
||||
else
|
||||
print("Failed to open file: ", FILENAME)
|
||||
end
|
||||
end
|
||||
|
||||
function allowJoin(v)
|
||||
@ -1256,6 +1261,7 @@ local function saveTime(player)
|
||||
StatTrack = true
|
||||
end
|
||||
|
||||
if isserver then
|
||||
local f = assert(io.open(FILENAME, "w"))
|
||||
if f == nil then
|
||||
print("Failed to open file for writing: " + FILENAME)
|
||||
@ -1280,6 +1286,7 @@ local function saveTime(player)
|
||||
end
|
||||
|
||||
f:close()
|
||||
end
|
||||
end
|
||||
|
||||
-- DEBUGGING
|
||||
@ -1379,10 +1386,15 @@ local function think()
|
||||
end
|
||||
end
|
||||
end
|
||||
if not cv_spbatk then
|
||||
cv_spbatk = CV_FindVar("spbatk")
|
||||
end
|
||||
|
||||
-- Gamemode flags
|
||||
Flags = $ & !(F_SPBATK | F_SPBEXP | F_SPBBIG | F_SPBJUS)
|
||||
if leveltime > START_TIME - (3 * TICRATE) / 2 and server.SPBArunning then
|
||||
if server.SPBArunning
|
||||
and cv_spbatk.value
|
||||
and leveltime > START_TIME - (3 * TICRATE) / 2 then
|
||||
Flags = $ | F_SPBATK
|
||||
if server.SPBAexpert then
|
||||
Flags = $ | F_SPBEXP
|
||||
@ -1405,10 +1417,18 @@ local function think()
|
||||
end
|
||||
end
|
||||
|
||||
-- make sure the spb actually spawned
|
||||
if leveltime == START_TIME - 1 then
|
||||
if not (server.SPBAbomb and server.SPBAbomb.valid) then
|
||||
-- it didn't spawn, clear spb flags
|
||||
Flags = $ & !(F_SPBATK | F_SPBEXP | F_SPBBIG | F_SPBJUS)
|
||||
end
|
||||
if not (Flags & F_SPBATK) then
|
||||
end
|
||||
|
||||
else
|
||||
hud.enable("freeplay")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
scoreTable = getScoreTable(gamemap, Flags)
|
||||
|
Reference in New Issue
Block a user