a bit stricter luacheck and some global leakage fixes

This commit is contained in:
BuckarooBanzay 2020-06-18 11:49:04 +02:00
parent f3fbd1f75d
commit 6525f11a5d
4 changed files with 4 additions and 6 deletions

View File

@ -1,10 +1,8 @@
unused_args = false unused_args = false
allow_defined_top = true
max_line_length = 999 max_line_length = 999
globals = { globals = {
"technic", "minetest", "technic", "technic_cnc", "minetest", "wrench"
"srcstack",
} }
read_globals = { read_globals = {

View File

@ -57,7 +57,7 @@ if minetest.get_modpath("moreblocks") then
tiles={"technic_stainless_steel_block.png"}, tiles={"technic_stainless_steel_block.png"},
}) })
function register_technic_stairs_alias(modname, origname, newmod, newname) local function register_technic_stairs_alias(modname, origname, newmod, newname)
minetest.register_alias(modname .. ":slab_" .. origname, newmod..":slab_" .. newname) minetest.register_alias(modname .. ":slab_" .. origname, newmod..":slab_" .. newname)
minetest.register_alias(modname .. ":slab_" .. origname .. "_inverted", newmod..":slab_" .. newname .. "_inverted") minetest.register_alias(modname .. ":slab_" .. origname .. "_inverted", newmod..":slab_" .. newname .. "_inverted")
minetest.register_alias(modname .. ":slab_" .. origname .. "_wall", newmod..":slab_" .. newname .. "_wall") minetest.register_alias(modname .. ":slab_" .. origname .. "_wall", newmod..":slab_" .. newname .. "_wall")

View File

@ -12,7 +12,7 @@ else
S = function (s) return s end S = function (s) return s end
end end
function technic_homedecor_node_is_owned(pos, placer) local function technic_homedecor_node_is_owned(pos, placer)
local ownername = false local ownername = false
if type(isprotect) == "function" then -- glomie's protection mod if type(isprotect) == "function" then -- glomie's protection mod
if not isprotect(5, pos, placer) then if not isprotect(5, pos, placer) then

View File

@ -236,7 +236,7 @@ local run = function(pos, node)
meta:set_int("src_time", meta:get_int("src_time") + 1) meta:set_int("src_time", meta:get_int("src_time") + 1)
if meta:get_int("src_time") >= 3 then -- 3 ticks per output if meta:get_int("src_time") >= 3 then -- 3 ticks per output
meta:set_int("src_time", 0) meta:set_int("src_time", 0)
srcstack = inv:get_stack("src", 1) local srcstack = inv:get_stack("src", 1)
srcstack:take_item() srcstack:take_item()
inv:set_stack("src", 1, srcstack) inv:set_stack("src", 1, srcstack)
inv:add_item("dst", result.." "..meta:get_int("cnc_multiplier")) inv:add_item("dst", result.." "..meta:get_int("cnc_multiplier"))