Merge branch 'master' into improve/creepers

This commit is contained in:
wallabra 2022-06-23 21:27:13 +00:00
commit 2eda3a6971
1 changed files with 7 additions and 6 deletions

View File

@ -156,6 +156,10 @@ minetest.register_globalstep(function(dtime)
object:set_velocity({x=0,y=0,z=0}) object:set_velocity({x=0,y=0,z=0})
object:set_acceleration({x=0,y=0,z=0}) object:set_acceleration({x=0,y=0,z=0})
if object._flowing then
object._flowing = false
end
object:move_to(checkpos) object:move_to(checkpos)
pool[name] = pool[name] + 1 pool[name] = pool[name] + 1
@ -795,6 +799,9 @@ minetest.register_entity(":__builtin:item", {
local oldvel = self.object:get_velocity() -- v is vector, vel is velocity local oldvel = self.object:get_velocity() -- v is vector, vel is velocity
-- apply gravity *before* drag computations
oldvel.y = oldvel.y - get_gravity() * dtime
-- drag -- drag
local fluid_drag = item_drop_settings.fluid_drag local fluid_drag = item_drop_settings.fluid_drag
@ -809,12 +816,6 @@ minetest.register_entity(":__builtin:item", {
newv.y = newv.y - (oldvel.y - newv.y) * fluid_drag * dtime newv.y = newv.y - (oldvel.y - newv.y) * fluid_drag * dtime
newv.z = newv.z - (oldvel.z - newv.z) * fluid_drag * dtime newv.z = newv.z - (oldvel.z - newv.z) * fluid_drag * dtime
newv.y = newv.y + -0.22 -- (keep slight downward thrust from previous version of code)
-- NOTE: is there any particular reason we have this, anyway?
-- since fluid drag is now on, we could as well just
-- apply gravity here; drag will slow down the fall
-- realistically
self.object:set_velocity({x = oldvel.x + newv.x * dtime, y = oldvel.y + newv.y * dtime, z = oldvel.z + newv.z * dtime}) self.object:set_velocity({x = oldvel.x + newv.x * dtime, y = oldvel.y + newv.y * dtime, z = oldvel.z + newv.z * dtime})
self.physical_state = true self.physical_state = true