From e9c51dfab40806c32346f461c52587236977408d Mon Sep 17 00:00:00 2001 From: orwell96 Date: Wed, 6 Dec 2017 21:27:04 +0100 Subject: Make sure an old_velocity is always passed Fixes crash on placing a new subway wagon --- advtrains/wagons.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3