From 90a7bd6a0afb6509e96bcb373f95b448ee7f3b1d Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 20 Apr 2021 17:50:03 +0000 Subject: Put torch/signlike node on floor if no paramtype2 (#11074) --- builtin/game/falling.lua | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'builtin/game/falling.lua') diff --git a/builtin/game/falling.lua b/builtin/game/falling.lua index 5450542ff..1f0a63993 100644 --- a/builtin/game/falling.lua +++ b/builtin/game/falling.lua @@ -84,9 +84,6 @@ core.register_entity(":__builtin:falling_node", { local textures if def.tiles and def.tiles[1] then local tile = def.tiles[1] - if def.drawtype == "torchlike" and def.paramtype2 ~= "wallmounted" then - tile = def.tiles[2] or def.tiles[1] - end if type(tile) == "table" then tile = tile.name end @@ -147,11 +144,7 @@ core.register_entity(":__builtin:falling_node", { -- Rotate entity if def.drawtype == "torchlike" then - if def.paramtype2 == "wallmounted" then - self.object:set_yaw(math.pi*0.25) - else - self.object:set_yaw(-math.pi*0.25) - end + self.object:set_yaw(math.pi*0.25) elseif ((node.param2 ~= 0 or def.drawtype == "nodebox" or def.drawtype == "mesh") and (def.wield_image == "" or def.wield_image == nil)) or def.drawtype == "signlike" @@ -165,8 +158,12 @@ core.register_entity(":__builtin:falling_node", { if euler then self.object:set_rotation(euler) end - elseif (def.paramtype2 == "wallmounted" or def.paramtype2 == "colorwallmounted") then + elseif (def.paramtype2 == "wallmounted" or def.paramtype2 == "colorwallmounted" or def.drawtype == "signlike") then local rot = node.param2 % 8 + if (def.drawtype == "signlike" and def.paramtype2 ~= "wallmounted" and def.paramtype2 ~= "colorwallmounted") then + -- Change rotation to "floor" by default for non-wallmounted paramtype2 + rot = 1 + end local pitch, yaw, roll = 0, 0, 0 if def.drawtype == "nodebox" or def.drawtype == "mesh" then if rot == 0 then -- cgit v1.2.3