aboutsummaryrefslogtreecommitdiff
path: root/advtrains
diff options
context:
space:
mode:
Diffstat (limited to 'advtrains')
-rw-r--r--advtrains/advtrains/wagons.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/advtrains/advtrains/wagons.lua b/advtrains/advtrains/wagons.lua
index 1074dc1..28de3fa 100644
--- a/advtrains/advtrains/wagons.lua
+++ b/advtrains/advtrains/wagons.lua
@@ -611,7 +611,7 @@ function wagon:get_off(seatno)
clicker:set_eye_offset({x=0,y=0,z=0}, {x=0,y=0,z=0})
local gp=self:train()
--code as in step - automatic get on
- if self.door_entry and gp.door_open and gp.door_open~=0 and gp.velocity==0 then
+ if self.door_entry and gp.door_open and gp.door_open~=0 and gp.velocity==0 and gp.index and gp.path then
local index=advtrains.get_real_path_index(gp, self.pos_in_train)
--using the mapping created by the trainlogic globalstep
for i, ino in ipairs(self.door_entry) do
@@ -631,7 +631,7 @@ function wagon:get_off(seatno)
return
end
end
- else--if not door_entry, use old method
+ else--if not door_entry, or paths missing, fall back to old method
local objpos=advtrains.round_vector_floor_y(self.object:getpos())
local yaw=self.object:getyaw()
local isx=(yaw < math.pi/4) or (yaw > 3*math.pi/4 and yaw < 5*math.pi/4) or (yaw > 7*math.pi/4)