]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - builtin/game/falling.lua
Fix rotation for falling mesh degrotate nodes (#11159)
[dragonfireclient.git] / builtin / game / falling.lua
index 1f0a63993e5309f63ea752319c7d4f75e2ea5c47..2cc0d8fac8ec4b9cd34c7869f5a392e3c965fde0 100644 (file)
@@ -205,6 +205,14 @@ core.register_entity(":__builtin:falling_node", {
                                        end
                                end
                                self.object:set_rotation({x=pitch, y=yaw, z=roll})
+                       elseif (def.drawtype == "mesh" and def.paramtype2 == "degrotate") then
+                               local p2 = (node.param2 - (def.place_param2 or 0)) % 240
+                               local yaw = (p2 / 240) * (math.pi * 2)
+                               self.object:set_yaw(yaw)
+                       elseif (def.drawtype == "mesh" and def.paramtype2 == "colordegrotate") then
+                               local p2 = (node.param2 % 32 - (def.place_param2 or 0) % 32) % 24
+                               local yaw = (p2 / 24) * (math.pi * 2)
+                               self.object:set_yaw(yaw)
                        end
                end
        end,