From 3dcfa8b32498a11d1cc8566a15f404faf3c87365 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Thu, 26 Aug 2021 01:32:51 +0200 Subject: [PATCH] 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. --- init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init.lua b/init.lua index 1fcb337..90d8410 100644 --- a/init.lua +++ b/init.lua @@ -356,6 +356,9 @@ minetest.register_node("meshnode:controller", { show_meshnode_formspec(pos, clicker) end, 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() if meta then if vector.equals(minetest.string_to_pos(meta), pos) then