From 53791c4f9db279f1a416a251e3585cec12e21c11 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 10 Jun 2017 21:39:26 +0200 Subject: [PATCH] Fix item speed not reset when magnet activates This fixes items sometimes flying upwards when near the player --- mods/ENTITIES/mcl_item_entity/init.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mods/ENTITIES/mcl_item_entity/init.lua b/mods/ENTITIES/mcl_item_entity/init.lua index 77cd8e6b30..42a3def168 100644 --- a/mods/ENTITIES/mcl_item_entity/init.lua +++ b/mods/ENTITIES/mcl_item_entity/init.lua @@ -88,15 +88,14 @@ minetest.register_globalstep(function(dtime) object:get_luaentity()._magnet_active = true object:get_luaentity()._collector_timer = 0 - --modified simplemobs api - -- Move object to player + disable_physics(object, object:get_luaentity()) + local opos = object:getpos() local vec = vector.subtract(checkpos, opos) vec = vector.add(opos, vector.divide(vec, 2)) object:moveto(vec) - disable_physics(object, object:get_luaentity(), false, false) --fix eternally falling items minetest.after(0, function(object)