1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-10-30 13:13:00 +00:00

Fixed error handling in scale subcommand (#816)

This commit is contained in:
JackMacWindows
2021-06-07 15:47:15 -04:00
committed by GitHub
parent 97faa1b3bc
commit 53efd6b303
2 changed files with 22 additions and 2 deletions

View File

@@ -7,7 +7,7 @@ local function printUsage()
end
local tArgs = { ... }
if #tArgs < 2 then
if #tArgs < 2 or tArgs[1] == "scale" and #tArgs < 3 then
printUsage()
return
end
@@ -21,7 +21,7 @@ if tArgs[1] == "scale" then
local nRes = tonumber(tArgs[3])
if nRes == nil or nRes < 0.5 or nRes > 5 then
print("Invalid scale: " .. nRes)
print("Invalid scale: " .. tArgs[3])
return
end