From 2826392927be23e07a02850be991b0e367645c98 Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Sat, 9 Mar 2024 18:08:34 +0100 Subject: [PATCH] ignore invalid param2 rotations --- schematic_orient.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/schematic_orient.lua b/schematic_orient.lua index 9fcc483..59b2f99 100644 --- a/schematic_orient.lua +++ b/schematic_orient.lua @@ -30,10 +30,18 @@ local function rotate_param2(node_name, param2, angle) local paramtype2 = def.paramtype2 if paramtype2 == "wallmounted" or paramtype2 == "colorwallmounted" then local orient = param2 % 8 + if not wallmounted_substitution[orient + 1] then + -- unknown rotation/param2 + return param2 + end return param2 - orient + wallmounted_substitution[orient + 1] elseif paramtype2 == "facedir" or paramtype2 == "colorfacedir" then local orient = param2 % 32 + if not facedir_substitution[orient + 1] then + -- unknown rotation/param2 + return param2 + end return param2 - orient + facedir_substitution[orient + 1] end