1
0
Fork 0

Replaced early returns with error calls

hollow_logs
the-real-herowl 2024-04-30 03:53:49 +02:00
parent e0aadc7996
commit ee2998e21b
1 changed files with 3 additions and 3 deletions

View File

@ -6,17 +6,17 @@ vl_hollow_logs = {}
---@param defs table {name:string, stripped_name>string, desc:string, stripped_desc:string, not_flammable:boolean|nil} ---@param defs table {name:string, stripped_name>string, desc:string, stripped_desc:string, not_flammable:boolean|nil}
function vl_hollow_logs.register_hollow_log(defs) function vl_hollow_logs.register_hollow_log(defs)
if not defs or #defs < 4 then if not defs or #defs < 4 then
return error("Incomplete definition provided")
end end
for i = 1, #defs do for i = 1, #defs do
if i == 5 then if i == 5 then
if type(defs[i]) ~= "boolean" and type(defs[i]) ~= "nil" then if type(defs[i]) ~= "boolean" and type(defs[i]) ~= "nil" then
return error("Invalid arg #5")
end end
else else
if type(defs[i]) ~= "string" then if type(defs[i]) ~= "string" then
return error("Invalid arg #".. tostring(i))
end end
end end
end end