From 25d67cee6a4b3fe8d21a8673cb4d6a6bd334cf62 Mon Sep 17 00:00:00 2001 From: Andrii Date: Thu, 5 Sep 2024 00:17:25 +0300 Subject: [PATCH] Add a comment --- inventory.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/inventory.lua b/inventory.lua index 30b95b7..6e0c6cc 100644 --- a/inventory.lua +++ b/inventory.lua @@ -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 @@ -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, @@ -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 })