Hopefully fix double-rightclick making items disappear
This commit is contained in:
parent
c78f2e5a8c
commit
6c68227b22
@ -104,6 +104,9 @@ local on_place_breakable = function(itemstack, placer, pointed_thing)
|
||||
elseif boxes.players_in_boxes[name] then
|
||||
-- check meta if we can place here
|
||||
local meta = minetest.get_meta(pos)
|
||||
if meta:get_string("placed") ~= "" then
|
||||
return itemstack
|
||||
end
|
||||
local placeable = meta:get_string("placeable")
|
||||
if placeable == "" then
|
||||
return itemstack
|
||||
@ -131,6 +134,8 @@ local on_place_breakable = function(itemstack, placer, pointed_thing)
|
||||
-- preserve metadata
|
||||
meta = minetest.get_meta(pos)
|
||||
meta:set_string("placeable", placeable)
|
||||
-- but set placed to true to avoid fast-rightclick bug
|
||||
meta:set_string("placed", "true")
|
||||
return itemstack
|
||||
else
|
||||
minetest.log("info", name .. " attempted to place a " .. place .. " outside a box")
|
||||
|
Loading…
x
Reference in New Issue
Block a user