Allow only meshnode glue in controller inventory
If a meshnode controller was trying to make sense of metadata from an item other than meshnode glue, the server would crash. To prevent this, only meshnode glue is allowed to be in a meshnode controller inventory.
This commit is contained in:
parent
ab6d4df25f
commit
3dcfa8b324
3
init.lua
3
init.lua
|
@ -356,6 +356,9 @@ minetest.register_node("meshnode:controller", {
|
||||||
show_meshnode_formspec(pos, clicker)
|
show_meshnode_formspec(pos, clicker)
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||||
|
if stack:get_name() ~= "meshnode:glue" then
|
||||||
|
return 0
|
||||||
|
end
|
||||||
local meta = stack:get_metadata()
|
local meta = stack:get_metadata()
|
||||||
if meta then
|
if meta then
|
||||||
if vector.equals(minetest.string_to_pos(meta), pos) then
|
if vector.equals(minetest.string_to_pos(meta), pos) then
|
||||||
|
|
Loading…
Reference in New Issue