From fc75bd10a0d7e5cb232483afef6bcb3c5b5e626d Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Sun, 1 Oct 2023 00:04:46 +0500 Subject: [PATCH] fix checkpoint error on checkpoint deletion --- beatrun/gamemodes/beatrun/entities/entities/tt_cp/shared.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beatrun/gamemodes/beatrun/entities/entities/tt_cp/shared.lua b/beatrun/gamemodes/beatrun/entities/entities/tt_cp/shared.lua index 9e50eb1..d65bb30 100644 --- a/beatrun/gamemodes/beatrun/entities/entities/tt_cp/shared.lua +++ b/beatrun/gamemodes/beatrun/entities/entities/tt_cp/shared.lua @@ -100,7 +100,7 @@ function ENT:DrawTranslucent() render.DrawBeam(newpos, newpos + circleup, 8, 0, 1, red, true) end - local nextCP = Checkpoints[self:GetCPNum() + 1] or self + local nextCP = IsValid(Checkpoints[self:GetCPNum() + 1]) and Checkpoints[self:GetCPNum() + 1] or self local selfpos = self:GetPos() + checkheight local fwAng = (nextCP:GetPos() - selfpos):GetNormalized():Angle()