From e795f512933687773acc4fd95607df1e757e1c43 Mon Sep 17 00:00:00 2001 From: orwell96 Date: Wed, 5 Apr 2017 13:35:39 +0200 Subject: Fix #59 --- advtrains/advtrains/wagons.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'advtrains') 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) -- cgit v1.2.3