Fix false win if detector stack in inventory
parent
3611a07290
commit
a93da1f623
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue