diff options
author | Wuzzy <wuzzy2@mail.ru> | 2021-09-01 20:20:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-01 22:20:57 +0200 |
commit | ff9945dc6eb33d054059fc48605ffea7c4b515d3 (patch) | |
tree | 1a1392d455409c63746cb24b754bd117988ff945 /builtin/game | |
parent | e912008cb368c7722b2a2ca48c6e53ab52076b8b (diff) | |
download | minetest-ff9945dc6eb33d054059fc48605ffea7c4b515d3.tar.gz minetest-ff9945dc6eb33d054059fc48605ffea7c4b515d3.tar.bz2 minetest-ff9945dc6eb33d054059fc48605ffea7c4b515d3.zip |
Fix falling mesh nodes being half size (#11389)
Diffstat (limited to 'builtin/game')
-rw-r--r-- | builtin/game/falling.lua | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/builtin/game/falling.lua b/builtin/game/falling.lua index 6db563534..29cb56aae 100644 --- a/builtin/game/falling.lua +++ b/builtin/game/falling.lua @@ -111,14 +111,21 @@ core.register_entity(":__builtin:falling_node", { itemstring = core.itemstring_with_palette(itemstring, node.param2) end -- FIXME: solution needed for paramtype2 == "leveled" - local s = (def.visual_scale or 1) * SCALE - if def.drawtype == "mesh" then - s = s * 0.5 + -- Calculate size of falling node + local s = {} + s.x = (def.visual_scale or 1) * SCALE + s.y = s.x + s.z = s.x + -- Compensate for wield_scale + if def.wield_scale then + s.x = s.x / def.wield_scale.x + s.y = s.y / def.wield_scale.y + s.z = s.z / def.wield_scale.z end self.object:set_properties({ is_visible = true, wield_item = itemstring, - visual_size = vector.new(s, s, s), + visual_size = s, glow = def.light_source, }) end |