forked from MineClone5/MineClone5
Fix ground drag var reference in item physics
This commit is contained in:
parent
2aa565ac21
commit
4105e07670
|
@ -790,9 +790,10 @@ 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
|
||||||
|
|
||||||
-- drag
|
-- drag
|
||||||
newv.x = newv.x - (oldvel.x - newv.x) * item_drop_settings.fluid_drag * dtime
|
local fluid_drag = item_drop_settings.fluid_drag
|
||||||
newv.y = newv.y - (oldvel.y - newv.y) * item_drop_settings.fluid_drag * dtime
|
newv.x = newv.x - (oldvel.x - newv.x) * fluid_drag * dtime
|
||||||
newv.z = newv.z - (oldvel.z - newv.z) * item_drop_settings.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.y = newv.y + -0.22 -- (keep slight downward thrust from previous version of code)
|
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?
|
-- NOTE: is there any particular reason we have this, anyway?
|
||||||
|
@ -843,6 +844,7 @@ minetest.register_entity(":__builtin:item", {
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local ground_drag = item_drop_settings.ground_drag
|
||||||
local newvel = {
|
local newvel = {
|
||||||
x = oldvel.x - oldvel.x * ground_drag * dtime,
|
x = oldvel.x - oldvel.x * ground_drag * dtime,
|
||||||
y = oldvel.y,
|
y = oldvel.y,
|
||||||
|
|
Loading…
Reference in New Issue