This commit is contained in:
Not 2022-03-28 13:13:42 +02:00
parent f1a886182c
commit e68ab38262
1 changed files with 19 additions and 9 deletions

View File

@ -9,6 +9,9 @@ local splits = {}
local PATCH = nil local PATCH = nil
local help = true local help = true
-- Retry / changelevel map
local nextMap = nil
local Flags = 0 local Flags = 0
-- SPB flags with the least significance first -- SPB flags with the least significance first
@ -99,11 +102,10 @@ local function allowJoin(v)
local y local y
if v then if v then
y = "yes" y = "yes"
--hud.enable("freeplay") hud.enable("freeplay")
else else
y = "no" y = "no"
-- Why in gods name does this work on a local server but fails on a public one hud.disable("freeplay")
--hud.disable("freeplay")
end end
COM_BufInsertText(server, "allowteamchange " + y) COM_BufInsertText(server, "allowteamchange " + y)
@ -140,10 +142,10 @@ end
local function retry(player, ...) local function retry(player, ...)
if doyoudare(player) then if doyoudare(player) then
-- Prevents bind crash -- Prevents bind crash
if leveltime < 15 then if leveltime < 20 then
return return
end end
COM_BufInsertText(server, "map " + G_BuildMapName(gamemap)) nextMap = G_BuildMapName(gamemap)
end end
end end
COM_AddCommand("retry", retry) COM_AddCommand("retry", retry)
@ -165,7 +167,7 @@ local function changelevel(player, ...)
if not doyoudare(player) then if not doyoudare(player) then
return return
end end
if leveltime < 15 then if leveltime < 20 then
return return
end end
@ -201,7 +203,7 @@ local function changelevel(player, ...)
return return
end end
COM_BufInsertText(server, "map " + (G_BuildMapName(mapnum))) nextMap = G_BuildMapName(mapnum)
end end
COM_AddCommand("changelevel", changelevel) COM_AddCommand("changelevel", changelevel)
@ -525,6 +527,10 @@ local function getGamer()
end end
local function think() local function think()
if nextMap then
COM_BufInsertText(server, "map " + nextMap)
nextMap = nil
end
if disable then if disable then
if ingame() > 1 then if ingame() > 1 then
@ -634,12 +640,16 @@ local function think()
end end
addHook("ThinkFrame", think) addHook("ThinkFrame", think)
local function resetTeamchange() local function interThink()
if nextMap then
COM_BufInsertText(server, "map " + nextMap)
nextMap = nil
end
if not CV_FindVar("allowteamchange").value then if not CV_FindVar("allowteamchange").value then
allowJoin(true) allowJoin(true)
end end
end end
addHook("IntermissionThinker", resetTeamchange) addHook("IntermissionThinker", interThink)
local function netvars(net) local function netvars(net)
lb = net($) lb = net($)