Minor optimization with startatone convar

This commit is contained in:
Denneisk 2024-12-25 16:05:21 -05:00
parent 8440b1a126
commit 292225e57f

View File

@ -1,3 +1,7 @@
local smh_startatone = CreateClientConVar("smh_startatone", 0, true, false, nil, 0, 1)
CreateClientConVar("smh_currentpreset", "default", true, false)
concommand.Add("+smh_menu", function()
SMH.Controller.OpenMenu()
end)
@ -41,7 +45,7 @@ end)
concommand.Add("smh_makejpeg", function(pl, cmd, args)
local startframe
if args[1] then
startframe = args[1] - GetConVar("smh_startatone"):GetInt()
startframe = args[1] - smh_startatone:GetInt()
else
startframe = 0
end
@ -56,7 +60,7 @@ end)
concommand.Add("smh_makescreenshot", function(pl, cmd, args)
local startframe
if args[1] then
startframe = args[1] - GetConVar("smh_startatone"):GetInt()
startframe = args[1] - smh_startatone:GetInt()
else
startframe = 0
end
@ -66,7 +70,4 @@ concommand.Add("smh_makescreenshot", function(pl, cmd, args)
else
print("Specified starting frame is outside of the current Frame Count!")
end
end)
CreateClientConVar("smh_startatone", 0, true, false, nil, 0, 1)
CreateClientConVar("smh_currentpreset", "default", true, false)
end)