From a93da1f62362f3080854a91e11c5812cd0eae4d8 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 10 Feb 2022 19:29:30 +0100 Subject: [PATCH] Fix false win if detector stack in inventory --- mods/lzr_laser/physics.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mods/lzr_laser/physics.lua b/mods/lzr_laser/physics.lua index 8624dbf..93637cd 100644 --- a/mods/lzr_laser/physics.lua +++ b/mods/lzr_laser/physics.lua @@ -218,9 +218,9 @@ function lzr_laser.check_inventory_detectors(player, detector_placed) local inv = player:get_inventory() local count = 0 for i=1, inv:get_size("main") do - local item = inv:get_stack("main", i):get_name() - if minetest.get_item_group(item, "detector") ~= 0 then - count = count + 1 + local item = inv:get_stack("main", i) + if minetest.get_item_group(item:get_name(), "detector") ~= 0 then + count = count + item:get_count() if (detector_placed and count > 1) or (not detector_placed) then return false end