fix checkpoint error on checkpoint deletion

This commit is contained in:
Jonny_Bro (Nikita) 2023-10-01 00:04:46 +05:00
parent 9ff173ab35
commit fc75bd10a0

View file

@ -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()