mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Fix rotation for falling mesh degrotate nodes (#11159)
This commit is contained in:
parent
734fb2c811
commit
228f1c6770
3 changed files with 20 additions and 9 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue