mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-24 20:03:45 +01:00
Fix bug where powered rails would not accelerate a fueled minecart
This commit is contained in:
parent
3772dd51cc
commit
59b6385d10
@ -409,14 +409,17 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
|
||||
|
||||
-- Slow down or speed up
|
||||
local acc = dir.y * -1.8
|
||||
|
||||
local friction = 0.4
|
||||
local speed_mod = minetest.registered_nodes[minetest.get_node(pos).name]._rail_acceleration
|
||||
|
||||
acc = acc - friction
|
||||
|
||||
if has_fuel then
|
||||
acc = acc + 0.2
|
||||
elseif speed_mod and speed_mod ~= 0 then
|
||||
acc = acc + speed_mod
|
||||
else
|
||||
acc = acc - 0.4
|
||||
acc = acc + 0.6
|
||||
end
|
||||
|
||||
if speed_mod and speed_mod ~= 0 then
|
||||
acc = acc + speed_mod + friction
|
||||
end
|
||||
|
||||
new_acc = vector.multiply(dir, acc)
|
||||
|
Loading…
Reference in New Issue
Block a user