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