Fix false win if detector stack in inventory

master
Wuzzy 2022-02-10 19:29:30 +01:00
parent 3611a07290
commit a93da1f623
1 changed files with 3 additions and 3 deletions

View File

@ -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