aboutsummaryrefslogtreecommitdiff
path: root/advtrains/wagons.lua
diff options
context:
space:
mode:
authororwell96 <mono96.mml@gmail.com>2017-12-06 21:27:04 +0100
committerGitHub <noreply@github.com>2017-12-06 21:27:04 +0100
commite9c51dfab40806c32346f461c52587236977408d (patch)
treeaa02891324acb9b5e3f490de59710c8af0b89d51 /advtrains/wagons.lua
parentdc67ff7226a2836863a0e709a5b81c90c977f288 (diff)
downloadadvtrains-e9c51dfab40806c32346f461c52587236977408d.tar.gz
advtrains-e9c51dfab40806c32346f461c52587236977408d.tar.bz2
advtrains-e9c51dfab40806c32346f461c52587236977408d.zip
Make sure an old_velocity is always passed
Fixes crash on placing a new subway wagon
Diffstat (limited to 'advtrains/wagons.lua')
-rw-r--r--advtrains/wagons.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua
index b30d3d4..3e73f39 100644
--- a/advtrains/wagons.lua
+++ b/advtrains/wagons.lua
@@ -519,7 +519,7 @@ function wagon:on_step(dtime)
self:update_animation(gp.velocity, self.old_velocity)
end
if self.custom_on_velocity_change then
- self:custom_on_velocity_change(gp.velocity, self.old_velocity)
+ self:custom_on_velocity_change(gp.velocity, self.old_velocity or 0)
end
end