aboutsummaryrefslogtreecommitdiff
path: root/advtrains/wagons.lua
diff options
context:
space:
mode:
Diffstat (limited to 'advtrains/wagons.lua')
-rw-r--r--advtrains/wagons.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua
index 3892813..4306b50 100644
--- a/advtrains/wagons.lua
+++ b/advtrains/wagons.lua
@@ -502,12 +502,16 @@ function wagon:on_step(dtime)
self.object:setyaw(yaw)
self.updatepct_timer=2
if self.update_animation then
- self:update_animation(gp.velocity)
+ 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)
end
end
self.old_velocity_vector=velocityvec
+ self.old_velocity = gp.velocity
self.old_acceleration_vector=accelerationvec
self.old_yaw=yaw
atprintbm("wagon step", t)