Fix item speed not reset when magnet activates
This fixes items sometimes flying upwards when near the player
This commit is contained in:
parent
5d1c38cb5f
commit
53791c4f9d
|
@ -88,15 +88,14 @@ minetest.register_globalstep(function(dtime)
|
||||||
object:get_luaentity()._magnet_active = true
|
object:get_luaentity()._magnet_active = true
|
||||||
object:get_luaentity()._collector_timer = 0
|
object:get_luaentity()._collector_timer = 0
|
||||||
|
|
||||||
--modified simplemobs api
|
|
||||||
|
|
||||||
-- Move object to player
|
-- Move object to player
|
||||||
|
disable_physics(object, object:get_luaentity())
|
||||||
|
|
||||||
local opos = object:getpos()
|
local opos = object:getpos()
|
||||||
local vec = vector.subtract(checkpos, opos)
|
local vec = vector.subtract(checkpos, opos)
|
||||||
vec = vector.add(opos, vector.divide(vec, 2))
|
vec = vector.add(opos, vector.divide(vec, 2))
|
||||||
object:moveto(vec)
|
object:moveto(vec)
|
||||||
|
|
||||||
disable_physics(object, object:get_luaentity(), false, false)
|
|
||||||
|
|
||||||
--fix eternally falling items
|
--fix eternally falling items
|
||||||
minetest.after(0, function(object)
|
minetest.after(0, function(object)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user