Simplify item settling, make instant.
The old method was designed for 0.4 compatibility. Since 5.0 there appears to be a flag we can just check to see if the item is still moving according to physics or settled.
This commit is contained in:
parent
a9b049db2c
commit
8a0f073592
@ -9,17 +9,8 @@ local bii = minetest.registered_entities["__builtin:item"]
|
||||
local newbii = {
|
||||
on_step = function(self, dtime, ...)
|
||||
bii.on_step(self, dtime, ...)
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
if not self.oldpos or not vector.equals(pos, self.oldpos) then
|
||||
self.oldpos = pos
|
||||
self.sitting = 0
|
||||
return
|
||||
end
|
||||
self.sitting = (self.sitting or 0) + dtime
|
||||
if self.sitting < 0.25 then return end
|
||||
|
||||
pos = vector.round(pos)
|
||||
if self.moving_state then return end
|
||||
local pos = vector.round(self.object:get_pos())
|
||||
local i = ItemStack(self.itemstring)
|
||||
pos = nodecore.scan_flood(pos, 5,
|
||||
function(p)
|
||||
|
Loading…
x
Reference in New Issue
Block a user