mirror of
https://github.com/minetest-mods/drawers.git
synced 2024-11-25 16:13:45 +01:00
fix common luacheck errors
This commit is contained in:
parent
fa8095c6a9
commit
dccb164133
@ -199,7 +199,7 @@ function drawers.drawer_insert_object(pos, node, stack, direction)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function drawers.drawer_can_insert_object(pos, node, stack, direction)
|
function drawers.drawer_can_insert_object(pos, node, stack, direction)
|
||||||
local drawer_visuals = drawers.drawer_visuals[core.serialize(pos)]
|
local drawer_visuals = drawers.drawer_visuals[core.serialize(pos)]
|
||||||
if not drawer_visuals then return false end
|
if not drawer_visuals then return false end
|
||||||
|
|
||||||
|
|
||||||
|
@ -232,7 +232,7 @@ local function controller_node_timer(pos, elapsed)
|
|||||||
2: Item is not stackable.
|
2: Item is not stackable.
|
||||||
3. Item is allowed and there is either an existing drawer for that item with room or an empty drawer.
|
3. Item is allowed and there is either an existing drawer for that item with room or an empty drawer.
|
||||||
4: Item is allowed, but there is no room.
|
4: Item is allowed, but there is no room.
|
||||||
|
|
||||||
There are three different possibilities for "current_state".
|
There are three different possibilities for "current_state".
|
||||||
1: "running" which means means it's operating normally.
|
1: "running" which means means it's operating normally.
|
||||||
2: "stopped" meaning the controller makes no attempt to put in the item possibly due to being unallowed for various reasons.
|
2: "stopped" meaning the controller makes no attempt to put in the item possibly due to being unallowed for various reasons.
|
||||||
|
@ -100,7 +100,7 @@ core.register_entity("drawers:visual", {
|
|||||||
self.meta = core.get_meta(self.drawer_pos)
|
self.meta = core.get_meta(self.drawer_pos)
|
||||||
|
|
||||||
-- collisionbox
|
-- collisionbox
|
||||||
local node = core.get_node(self.drawer_pos)
|
node = core.get_node(self.drawer_pos)
|
||||||
local colbox
|
local colbox
|
||||||
if self.drawerType ~= 2 then
|
if self.drawerType ~= 2 then
|
||||||
if node.param2 == 1 or node.param2 == 3 then
|
if node.param2 == 1 or node.param2 == 3 then
|
||||||
@ -221,7 +221,7 @@ core.register_entity("drawers:visual", {
|
|||||||
end
|
end
|
||||||
local inv = puncher:get_inventory()
|
local inv = puncher:get_inventory()
|
||||||
if inv == nil then
|
if inv == nil then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local spaceChecker = ItemStack(self.itemName)
|
local spaceChecker = ItemStack(self.itemName)
|
||||||
if add_stack then
|
if add_stack then
|
||||||
@ -231,7 +231,7 @@ core.register_entity("drawers:visual", {
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
stack = self:take_items(add_stack)
|
local stack = self:take_items(add_stack)
|
||||||
if stack ~= nil then
|
if stack ~= nil then
|
||||||
-- add removed stack to player's inventory
|
-- add removed stack to player's inventory
|
||||||
inv:add_item("main", stack)
|
inv:add_item("main", stack)
|
||||||
|
Loading…
Reference in New Issue
Block a user