mirror of
https://github.com/JonnyBro/beatrun.git
synced 2024-12-29 05:13:02 +05:00
Allow replay system to actually work (idiot move)
This commit is contained in:
parent
a7dd8b9624
commit
1c1e58ac98
2 changed files with 18 additions and 21 deletions
|
@ -44,7 +44,7 @@ function ENT:StartTouch(ent)
|
|||
ent:SetNW2Int("CPNum", ent:GetNW2Int("CPNum", 1) + 1)
|
||||
|
||||
if ent:GetNW2Int("CPNum", 1) > table.Count(Checkpoints) then
|
||||
-- ReplayStop(ent)
|
||||
ReplayStop(ent)
|
||||
FinishCourse(ent)
|
||||
else
|
||||
ent.CPSavePos = ent:GetPos()
|
||||
|
|
|
@ -134,7 +134,7 @@ if CLIENT then
|
|||
|
||||
LocalPlayer():EmitSound("A_TT_Finish_Positive.wav")
|
||||
SaveCheckpointTime()
|
||||
-- SaveReplayData()
|
||||
SaveReplayData()
|
||||
else
|
||||
timetext = "+" .. string.FormattedTime(math.abs(timestr), "%02i:%02i:%02i")
|
||||
timecolor = color_negative
|
||||
|
@ -169,7 +169,7 @@ local finishcolor = Color(45, 45, 175, 100)
|
|||
|
||||
function FinishCourse(ply)
|
||||
ply:ScreenFade(SCREENFADE.IN, finishcolor, 0, 4)
|
||||
-- ply:SetLaggedMovementValue(0.1)
|
||||
ply:SetLaggedMovementValue(0.1)
|
||||
ply:DrawViewModel(false)
|
||||
|
||||
net.Start("Checkpoint_Finish")
|
||||
|
@ -178,7 +178,7 @@ function FinishCourse(ply)
|
|||
ply:SetNW2Int("CPNum", -1)
|
||||
|
||||
timer.Simple(4, function()
|
||||
-- ply:SetLaggedMovementValue(1)
|
||||
ply:SetLaggedMovementValue(1)
|
||||
ply:DrawViewModel(true)
|
||||
end)
|
||||
end
|
||||
|
@ -354,23 +354,20 @@ function LoadCheckpointTime()
|
|||
return times or nil
|
||||
end
|
||||
|
||||
-- function SaveReplayData()
|
||||
-- local replay = util.Compress(util.TableToJSON(LocalPlayer().ReplayTicks))
|
||||
-- local dir = "beatrun/replays/" .. game.GetMap() .. "/"
|
||||
|
||||
-- if not replay then return end
|
||||
|
||||
-- file.CreateDir(dir)
|
||||
-- file.Write(dir .. Course_ID .. ".txt", replay)
|
||||
-- end
|
||||
|
||||
-- function LoadReplayData()
|
||||
-- local dir = "beatrun/replays/" .. game.GetMap() .. "/"
|
||||
-- local replay = file.Read(dir .. Course_ID .. ".txt")
|
||||
-- replay = replay and util.JSONToTable(util.Decompress(replay))
|
||||
|
||||
-- return replay or nil
|
||||
-- end
|
||||
function SaveReplayData()
|
||||
PrintTable(LocalPlayer().ReplayTicks)
|
||||
local replay = util.Compress(util.TableToJSON(LocalPlayer().ReplayTicks))
|
||||
local dir = "beatrun/replays/" .. game.GetMap() .. "/"
|
||||
if not replay then return end
|
||||
file.CreateDir(dir)
|
||||
file.Write(dir .. Course_ID .. ".txt", replay)
|
||||
end
|
||||
function LoadReplayData()
|
||||
local dir = "beatrun/replays/" .. game.GetMap() .. "/"
|
||||
local replay = file.Read(dir .. Course_ID .. ".txt")
|
||||
replay = replay and util.JSONToTable(util.Decompress(replay))
|
||||
return replay or nil
|
||||
end
|
||||
|
||||
function StartCourse(spawntime)
|
||||
local faststartmult = LocalPlayer():GetInfoNum("Beatrun_FastStart", 0) > 0 and 0.5 or 1
|
||||
|
|
Loading…
Reference in a new issue