Fix falling_node rapid column settling.

This commit is contained in:
Aaron Suen 2020-01-11 00:34:13 -05:00
parent 25be3b07a8
commit 0c39f34ebb
2 changed files with 4 additions and 3 deletions

View File

@ -78,11 +78,11 @@ local function collides(pos)
if def.walkable then return node end if def.walkable then return node end
end end
function nodecore.entity_settle_check(on_settle) function nodecore.entity_settle_check(on_settle, isnode)
return function(self) return function(self)
local pos = self.object:get_pos() local pos = self.object:get_pos()
local yvel = self.object:get_velocity().y local yvel = self.object:get_velocity().y
local coll = self.not_rising and yvel == 0 local coll = (isnode or self.not_rising and yvel == 0)
and collides({x = pos.x, y = pos.y - 0.75, z = pos.z}) and collides({x = pos.x, y = pos.y - 0.75, z = pos.z})
self.not_rising = yvel <= 0 self.not_rising = yvel <= 0
if not coll then if not coll then

View File

@ -102,7 +102,8 @@ minetest.register_entity(":__builtin:falling_node", {
self.object:remove() self.object:remove()
return true return true
end), end,
true),
on_step = function(self, ...) on_step = function(self, ...)
if not self.node then return self.object:remove() end if not self.node then return self.object:remove() end