mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-04 15:21:06 +01:00
Replaced early returns with error calls
This commit is contained in:
parent
e0aadc7996
commit
ee2998e21b
1 changed files with 3 additions and 3 deletions
|
@ -6,17 +6,17 @@ vl_hollow_logs = {}
|
|||
---@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)
|
||||
if not defs or #defs < 4 then
|
||||
return
|
||||
error("Incomplete definition provided")
|
||||
end
|
||||
|
||||
for i = 1, #defs do
|
||||
if i == 5 then
|
||||
if type(defs[i]) ~= "boolean" and type(defs[i]) ~= "nil" then
|
||||
return
|
||||
error("Invalid arg #5")
|
||||
end
|
||||
else
|
||||
if type(defs[i]) ~= "string" then
|
||||
return
|
||||
error("Invalid arg #".. tostring(i))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue