Crash on putting item that is not meshnode glue in meshnode controller #3

Closed
opened 2021-08-20 20:18:18 +02:00 by erlehmann · 2 comments
Owner
How to reproduce
  1. Swap the meshnode glue from a meshnode controller with another item
  2. Observe crash
##### How to reproduce 1. Swap the meshnode glue from a meshnode controller with another item 2. Observe crash
Author
Owner

Fix:

diff --git a/init.lua b/init.lua
index d20dcec..199319e 100644
--- a/init.lua
+++ b/init.lua
@@ -356,6 +368,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
Fix: ``` diff --git a/init.lua b/init.lua index d20dcec..199319e 100644 --- a/init.lua +++ b/init.lua @@ -356,6 +368,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 ```
Member

fixed by #9

fixed by #9
cora closed this issue 2021-08-26 02:07:41 +02:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Mineclonia/mcl_meshnode#3
No description provided.