aboutsummaryrefslogtreecommitdiff
path: root/advtrains/wagons.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2021-01-02 19:56:12 +0100
committerorwell96 <orwell@bleipb.de>2021-02-10 16:39:46 +0100
commit0cef88ba7fec8d3ffefcd48671923b15255500f5 (patch)
treebabc27b0747277e01c3c38a94556c2b85d7c964a /advtrains/wagons.lua
parent4f7c1b1b5d5cdd4f6781ce115ab5110b05d8d13f (diff)
downloadadvtrains-0cef88ba7fec8d3ffefcd48671923b15255500f5.tar.gz
advtrains-0cef88ba7fec8d3ffefcd48671923b15255500f5.tar.bz2
advtrains-0cef88ba7fec8d3ffefcd48671923b15255500f5.zip
Add global slowdown factor instead of hard dtime limiting
Diffstat (limited to 'advtrains/wagons.lua')
-rw-r--r--advtrains/wagons.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua
index 7b6a381..38d81db 100644
--- a/advtrains/wagons.lua
+++ b/advtrains/wagons.lua
@@ -495,8 +495,8 @@ function wagon:on_step(dtime)
end
--FIX: use index of the wagon, not of the train.
- local velocity = train.velocity
- local acceleration = (train.acceleration or 0)
+ local velocity = train.velocity * advtrains.global_slowdown
+ local acceleration = (train.acceleration or 0) * (advtrains.global_slowdown*advtrains.global_slowdown)
local velocityvec = vector.multiply(vdir, velocity)
local accelerationvec = vector.multiply(vdir, acceleration)