1
0
mirror of https://github.com/SmallJoker/boost_cart.git synced 2024-12-25 02:10:19 +01:00

Revert velocity calculation change from e3688b5

Accelerates carts too much when going up/downhill
Caused by wrong vector length calculation. This will need to be altered again if there will be 45° rails
This commit is contained in:
SmallJoker 2017-11-28 18:32:29 +01:00
parent 49028ca123
commit 57d09fac79

View File

@ -232,7 +232,7 @@ function cart_entity:on_step(dtime)
else else
-- Direction change detected -- Direction change detected
if dir_changed then if dir_changed then
vel = vector.multiply(dir, v3_len(vel)) vel = vector.multiply(dir, math.abs(vel.x + vel.z))
update.vel = true update.vel = true
if dir.y ~= self.old_dir.y then if dir.y ~= self.old_dir.y then
pos = vector.round(pos) pos = vector.round(pos)