Item drop: Tune to land exactly 2 nodes away with level view (#6410)
authorParamat <paramat@users.noreply.github.com>
Tue, 12 Sep 2017 22:01:50 +0000 (23:01 +0100)
committerLoïc Blot <nerzhul@users.noreply.github.com>
Tue, 12 Sep 2017 22:01:50 +0000 (00:01 +0200)
builtin/game/item.lua

index 2c72005245e3193c0a761758b79ac730bd055c18..03eee3a6167e89325c365ef9f64e55ed9ed89f81 100644 (file)
@@ -426,9 +426,9 @@ function core.item_drop(itemstack, dropper, pos)
                local item = itemstack:take_item(cnt)
                local obj = core.add_item(p, item)
                if obj then
-                       dir.x = dir.x * 2
-                       dir.y = dir.y * 2 + 2
-                       dir.z = dir.z * 2
+                       dir.x = dir.x * 2.9
+                       dir.y = dir.y * 2.9 + 2
+                       dir.z = dir.z * 2.9
                        obj:set_velocity(dir)
                        obj:get_luaentity().dropped_by = dropper:get_player_name()
                        return itemstack