diff options
author | orwell96 <mono96.mml@gmail.com> | 2017-12-06 21:27:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-06 21:27:04 +0100 |
commit | e9c51dfab40806c32346f461c52587236977408d (patch) | |
tree | aa02891324acb9b5e3f490de59710c8af0b89d51 | |
parent | dc67ff7226a2836863a0e709a5b81c90c977f288 (diff) | |
download | advtrains-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
-rw-r--r-- | advtrains/wagons.lua | 2 |
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
|