diff --git a/beatrun/gamemodes/beatrun/gamemode/cl/HUD.lua b/beatrun/gamemodes/beatrun/gamemode/cl/HUD.lua index 61dfac9..881ca02 100644 --- a/beatrun/gamemodes/beatrun/gamemode/cl/HUD.lua +++ b/beatrun/gamemodes/beatrun/gamemode/cl/HUD.lua @@ -138,7 +138,7 @@ local function BeatrunHUD() surface.DrawText(version_text) surface.SetFont("BeatrunHUD") - if not VERSIONLATEST then + if VERSIONGLOBAL ~= VERSIONLATEST then local update_text = "Update available!" local notlatest_w, _ = surface.GetTextSize(update_text) surface.SetTextColor(255, 255, 255, 30) diff --git a/beatrun/gamemodes/beatrun/gamemode/cl_init.lua b/beatrun/gamemodes/beatrun/gamemode/cl_init.lua index 8bb0030..7b719c4 100644 --- a/beatrun/gamemodes/beatrun/gamemode/cl_init.lua +++ b/beatrun/gamemodes/beatrun/gamemode/cl_init.lua @@ -2,18 +2,4 @@ include("shared.lua") for _, v in ipairs(file.Find("gamemodes/beatrun/gamemode/cl/*.lua", "GAME")) do include("cl/" .. v) -end - -http.Fetch("https://raw.githubusercontent.com/JonnyBro/beatrun/main/version.txt", function(body, size, headers, code) - if code == 200 then - if body == VERSIONGLOBAL then - VERSIONLATEST = true - else - VERSIONLATEST = false - end - else - print("Error while checking version:\n" .. body) - end -end, function(e) - print("Error while checking version:\n" .. e) -end) \ No newline at end of file +end \ No newline at end of file diff --git a/beatrun/gamemodes/beatrun/gamemode/shared.lua b/beatrun/gamemodes/beatrun/gamemode/shared.lua index 21895ec..ae62a20 100644 --- a/beatrun/gamemodes/beatrun/gamemode/shared.lua +++ b/beatrun/gamemodes/beatrun/gamemode/shared.lua @@ -1,5 +1,5 @@ -VERSIONGLOBAL = "1.0.9" -VERSIONLATEST = NULL +VERSIONGLOBAL = "1.0.10" +VERSIONLATEST = "" DeriveGamemode("sandbox") @@ -13,4 +13,14 @@ include("player_class/player_beatrun.lua") for _, v in ipairs(file.Find("gamemodes/beatrun/gamemode/sh/*.lua", "GAME", "nameasc")) do AddCSLuaFile("sh/" .. v) include("sh/" .. v) -end \ No newline at end of file +end + +http.Fetch("https://raw.githubusercontent.com/JonnyBro/beatrun/main/version.txt", function(body, size, headers, code) + if code == 200 then + VERSIONLATEST = body:gsub("[\n\r]", "") + else + print("Error while checking version (not 200 code):\n" .. body) + end +end, function(e) + print("Error while checking version (error on fetch):\n" .. e) +end) \ No newline at end of file diff --git a/version.txt b/version.txt index 66c4c22..7ee7020 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.0.9 +1.0.10