aboutsummaryrefslogtreecommitdiff
path: root/advtrains/wagons.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2017-11-29 17:20:46 +0100
committerorwell96 <orwell@bleipb.de>2017-11-29 17:20:46 +0100
commit83df46d7865aa762afda2bdb6b786cd04bf9480d (patch)
treec8abb20ac97bb3e3813855349c7904803196cc03 /advtrains/wagons.lua
parent7681de96c95a716f7910a42b0f2beb5b23b1df47 (diff)
downloadadvtrains-83df46d7865aa762afda2bdb6b786cd04bf9480d.tar.gz
advtrains-83df46d7865aa762afda2bdb6b786cd04bf9480d.tar.bz2
advtrains-83df46d7865aa762afda2bdb6b786cd04bf9480d.zip
Change name of update_animation function
I will use this for sounds, and so it needs to be changed to a more general name
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)