Skip to content

Commit

Permalink
Add a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
andriyndev committed Sep 4, 2024
1 parent 785050d commit 25d67ce
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions inventory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ local function send_and_clear_batch(pos, channel)
last_message_time_for_chest[pos_hash] = nil
end

local function flush_batch_for_chest(pos)
-- Send all the batched messages for the chest if present
local function send_batch_for_chest(pos)
if not batched_messages[minetest.hash_node_position(pos)] then
return
end
Expand Down Expand Up @@ -244,7 +245,7 @@ minetest.register_node("digilines:chest", {
inv:set_size("main", 8*4)
end,
on_destruct = function(pos)
flush_batch_for_chest(pos)
send_batch_for_chest(pos)
end,
after_place_node = tubescan,
after_dig_node = tubescan,
Expand Down Expand Up @@ -384,7 +385,7 @@ minetest.register_node("digilines:chest", {
end,
on_timer = function(pos, _)
-- Send all the batched messages when enough time since the last message passed
flush_batch_for_chest(pos)
send_batch_for_chest(pos)
return false
end
})
Expand Down

0 comments on commit 25d67ce

Please sign in to comment.