Make sure an old_velocity is always passed

Fixes crash on placing a new subway wagon
This commit is contained in:
orwell96 2017-12-06 21:27:04 +01:00 committed by GitHub
parent dc67ff7226
commit e9c51dfab4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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