From 46d347c00aac65a3febda007de0c1b87457ea7d6 Mon Sep 17 00:00:00 2001 From: sys4 Date: Sun, 18 Jul 2021 21:02:35 +0200 Subject: [PATCH] Avoid crash if place a stair like node on colored one of same categorie --- stairsplus/common.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stairsplus/common.lua b/stairsplus/common.lua index 5534d8f..49a4e7e 100644 --- a/stairsplus/common.lua +++ b/stairsplus/common.lua @@ -49,6 +49,8 @@ stairsplus.rotate_node_aux = function(itemstack, placer, pointed_thing) local under = pointed_thing.under local under_node = minetest.get_node(under) local under_prefix = under_node and name_to_category(under_node.name) + -- NALC Addition to avoid coloredwood/unifiedbricks crash by Sys4 + local under_pmod = string.sub(under_node.name, 1, string.find(under_node.name, ":")-1) local same_cat = item_prefix == under_prefix @@ -65,7 +67,8 @@ stairsplus.rotate_node_aux = function(itemstack, placer, pointed_thing) -- under node has a non-standard shape, so use the distance between under and above local wallmounted = minetest.dir_to_wallmounted(vector.subtract(pointed_thing.above, under)) - if same_cat and not aux then + if same_cat and (under_pmod ~= "coloredwood" and under_pmod ~= "unifiedbricks") + and not aux then p2 = under_node.param2 -- flip if placing above or below an upright or upside-down node -- TODO should we also flip when placing next to a side-mounted node?