summaryrefslogtreecommitdiff
path: root/builtin/game/falling.lua
diff options
context:
space:
mode:
authorWuzzy <wuzzy2@mail.ru>2021-04-28 06:38:47 +0000
committerGitHub <noreply@github.com>2021-04-28 08:38:47 +0200
commit228f1c67704ab8014d30a3301bd15a1a88324ce0 (patch)
treeebd7265d7d8dca391a41a4ba9501f14fe102ecfc /builtin/game/falling.lua
parent734fb2c811cdb0c26153c2bd5b62e458343963e7 (diff)
downloadminetest-228f1c67704ab8014d30a3301bd15a1a88324ce0.tar.gz
minetest-228f1c67704ab8014d30a3301bd15a1a88324ce0.tar.bz2
minetest-228f1c67704ab8014d30a3301bd15a1a88324ce0.zip
Fix rotation for falling mesh degrotate nodes (#11159)
Diffstat (limited to 'builtin/game/falling.lua')
-rw-r--r--builtin/game/falling.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/builtin/game/falling.lua b/builtin/game/falling.lua
index 1f0a63993..2cc0d8fac 100644
--- a/builtin/game/falling.lua
+++ b/builtin/game/falling.lua
@@ -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,