fix glitched floating items

This commit is contained in:
tenplus1 2021-07-18 15:09:42 +01:00
parent 7bc7a704da
commit c1340e1b67

View File

@ -441,7 +441,10 @@ core.register_entity(":__builtin:item", {
step_gravity = function(self) step_gravity = function(self)
if self.falling_state then local vel = self.object:get_velocity()
-- apply gravity if falling or Y velocity not 0 (just incase)
if self.falling_state or (vel and vel.y ~= 0) then
self.accel.y = self.accel.y - gravity self.accel.y = self.accel.y - gravity
end end
end, end,