]> git.lizzy.rs Git - dragonfireclient.git/commitdiff
Fix falling mesh nodes being half size (#11389)
authorWuzzy <wuzzy2@mail.ru>
Wed, 1 Sep 2021 20:20:57 +0000 (20:20 +0000)
committerGitHub <noreply@github.com>
Wed, 1 Sep 2021 20:20:57 +0000 (22:20 +0200)
builtin/game/falling.lua

index 6db56353449535fa45add44b4051feaa475d898f..29cb56aae046d5da43f11957026dfd3faa9b6a9d 100644 (file)
@@ -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