From fd07e344d826cb6ef45493df37e71e622bb5ffa7 Mon Sep 17 00:00:00 2001 From: LostTrackpad Date: Wed, 7 Aug 2024 19:54:34 +0700 Subject: [PATCH] Reorder some code to prevent extra print calls --- beatrun/gamemodes/beatrun/gamemode/sh/Replay.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Replay.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Replay.lua index be92d61..d394a86 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Replay.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Replay.lua @@ -42,12 +42,12 @@ end function ReplayStop(ply, dontsave) --if not game.SinglePlayer() then return end + if not ply.ReplayTicks then return end + if ply.InReplay then return end if dontsave then print("Replay Ended - NOT SAVED") return end - if not ply.ReplayTicks then return end - if ply.InReplay then return end print("Ending Replay (" .. #ply.ReplayTicks .. "ticks)") @@ -143,9 +143,9 @@ function ReplaySendToClient(ply, args) local compressedreplay = util.Compress(util.TableToJSON(replaydata)) - if replaydata[3] != engine.TickInterval then - errorstring = "Replay tickrate and current tickrate does not match. Replay tick interval is: " .. (1 / engine.TickInterval()) - ErrorNoHalt(errorstring) + if replaydata[3] != engine.TickInterval() then + errorstring = "Replay tickrate and current tickrate does not match. Replay tick interval is: " .. (replaydata[3]) .. " " .. engine.TickInterval() + print(errorstring) end net.Start("ReplaySendToClient")