mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2025-04-21 14:55:15 +02:00
Fixes #4831: add gravity to acceleration on sloped track
I noticed that at
[movement.lua:303](cfd214df76/mods/ENTITIES/mcl_minecarts/movement.lua (L303)
)
in calculate_acceleration, the check for applying gravity overrides the
acceleration instead of taking power (`node_dev._rail_acceleration`)
into account.
I changed this to adding the gravity to the acceleration calculated so
far and confirmed that it fixes the bug.
This commit is contained in:
parent
5d11ef0c31
commit
1b60c7fae0
1 changed files with 2 additions and 2 deletions
|
@ -303,9 +303,9 @@ local function calculate_acceleration(staticdata)
|
|||
-- Factor in gravity after everything else
|
||||
local gravity_strength = 2.45 --friction * 5
|
||||
if staticdata.dir.y < 0 then
|
||||
acceleration = gravity_strength - FRICTION
|
||||
acceleration = acceleration + gravity_strength
|
||||
elseif staticdata.dir.y > 0 then
|
||||
acceleration = -gravity_strength + FRICTION
|
||||
acceleration = acceleration - gravity_strength
|
||||
end
|
||||
|
||||
return acceleration
|
||||
|
|
Loading…
Add table
Reference in a new issue