Fix for random lua error in multiplayer

Merge pull request #42 from RedyRT/master
This commit is contained in:
Nikita 2023-07-28 21:16:37 +05:00 committed by GitHub
commit 8699efe670
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -246,6 +246,8 @@ function CourseHUD()
text = speed .. " km/h" text = speed .. " km/h"
local w, _ = surface.GetTextSize(text) local w, _ = surface.GetTextSize(text)
w = w or 0
local r, g, b, a = string.ToColor(GetConVar("Beatrun_HUDTextColor"):GetString()) local r, g, b, a = string.ToColor(GetConVar("Beatrun_HUDTextColor"):GetString())
surface.SetDrawColor(255, 255, 255, 255) surface.SetDrawColor(255, 255, 255, 255)
@ -267,6 +269,8 @@ function CourseHUD()
if timealpha > 0 then if timealpha > 0 then
local w, _ = surface.GetTextSize(timetext) local w, _ = surface.GetTextSize(timetext)
w = w or 0
timealpha = math.max(0, timealpha - FrameTime() * 250) timealpha = math.max(0, timealpha - FrameTime() * 250)
timecolor.a = math.min(255, timealpha) timecolor.a = math.min(255, timealpha)