mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-26 12:31:05 +01:00
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
1 changed files with 2 additions and 3 deletions
|
@ -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 a new issue