diff --git a/beatrun/gamemodes/beatrun/gamemode/cl/HUD.lua b/beatrun/gamemodes/beatrun/gamemode/cl/HUD.lua index af0c0db..61dfac9 100644 --- a/beatrun/gamemodes/beatrun/gamemode/cl/HUD.lua +++ b/beatrun/gamemodes/beatrun/gamemode/cl/HUD.lua @@ -138,17 +138,13 @@ local function BeatrunHUD() surface.DrawText(version_text) surface.SetFont("BeatrunHUD") - if file.Exists("beatrun/version.txt", "DATA") then - local latest_version = file.Read("beatrun/version.txt", "DATA") - - if latest_version ~= VERSIONGLOBAL then - local update_text = "Update available!" - local notlatest_w, _ = surface.GetTextSize(update_text) - surface.SetTextColor(255, 255, 255, 30) - surface.SetTextPos(scrw - notlatest_w, 10) - surface.DrawText(update_text) - surface.SetFont("BeatrunHUD") - end + if not VERSIONLATEST then + local update_text = "Update available!" + local notlatest_w, _ = surface.GetTextSize(update_text) + surface.SetTextColor(255, 255, 255, 30) + surface.SetTextPos(scrw - notlatest_w, 10) + surface.DrawText(update_text) + surface.SetFont("BeatrunHUD") end local pl = ply:GetNW2Int("PLoss") diff --git a/beatrun/gamemodes/beatrun/gamemode/cl_init.lua b/beatrun/gamemodes/beatrun/gamemode/cl_init.lua index c178950..8bb0030 100644 --- a/beatrun/gamemodes/beatrun/gamemode/cl_init.lua +++ b/beatrun/gamemodes/beatrun/gamemode/cl_init.lua @@ -6,14 +6,10 @@ end http.Fetch("https://raw.githubusercontent.com/JonnyBro/beatrun/main/version.txt", function(body, size, headers, code) if code == 200 then - if not file.Exists("beatrun/version.txt", "DATA") then - file.Write("beatrun/version.txt", body) - end - - if body ~= VERSIONGLOBAL then - file.Write("beatrun/version.txt", body) + if body == VERSIONGLOBAL then + VERSIONLATEST = true else - print("Latest version already") + VERSIONLATEST = false end else print("Error while checking version:\n" .. body) diff --git a/beatrun/gamemodes/beatrun/gamemode/shared.lua b/beatrun/gamemodes/beatrun/gamemode/shared.lua index 5dfbf66..21895ec 100644 --- a/beatrun/gamemodes/beatrun/gamemode/shared.lua +++ b/beatrun/gamemodes/beatrun/gamemode/shared.lua @@ -1,4 +1,5 @@ -VERSIONGLOBAL = "1.0.8" +VERSIONGLOBAL = "1.0.9" +VERSIONLATEST = NULL DeriveGamemode("sandbox")