aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authororwell96 <mono96.mml@gmail.com>2018-02-07 22:29:08 +0100
committerGitHub <noreply@github.com>2018-02-07 22:29:08 +0100
commit06cdb14f3d28780f011d842c17580c748d2020f2 (patch)
tree29828feabd1eeba06500066e6d62cf07ebcba0c4
parentc93a5bf39043651cf5b4ef486541d86644dc169f (diff)
downloadadvtrains-06cdb14f3d28780f011d842c17580c748d2020f2.tar.gz
advtrains-06cdb14f3d28780f011d842c17580c748d2020f2.tar.bz2
advtrains-06cdb14f3d28780f011d842c17580c748d2020f2.zip
Do not crash when player gets on a train while it`s turning
-rw-r--r--advtrains/wagons.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua
index ee668ac..fd01abd 100644
--- a/advtrains/wagons.lua
+++ b/advtrains/wagons.lua
@@ -526,7 +526,7 @@ function wagon:on_step(dtime)
self.player_yaw[name] = p:get_look_horizontal()-self.old_yaw
end
-- set player looking direction using calculated offset
- p:set_look_horizontal(self.player_yaw[name]+yaw)
+ p:set_look_horizontal((self.player_yaw[name] or 0)+yaw)
end
end
self.turning = true