Fix crash if place compass on unknown node

master
Wuzzy 2022-07-23 13:26:08 +02:00
parent 2ea13a97ca
commit b2125f311b
1 changed files with 2 additions and 2 deletions

View File

@ -216,9 +216,9 @@ for c=0,7 do
else
local nodedef = minetest.registered_nodes[node.name]
local nodeyaw = 0
if nodedef and nodedef.paramtype2 == "wallmounted" or nodedef.paramtype2 == "colorwallmounted" then
if nodedef and (nodedef.paramtype2 == "wallmounted" or nodedef.paramtype2 == "colorwallmounted") then
nodeyaw = minetest.dir_to_yaw(minetest.wallmounted_to_dir(node.param2))
elseif nodedef and nodedef.paramtype2 == "facedir" or nodedef.paramtype2 == "colorfacedir" then
elseif nodedef and (nodedef.paramtype2 == "facedir" or nodedef.paramtype2 == "colorfacedir") then
nodeyaw = minetest.dir_to_yaw(minetest.facedir_to_dir(node.param2))
end
-- Special case: Item frame. Add a little offset for nodepos as