aboutsummaryrefslogtreecommitdiff
path: root/advtrains
diff options
context:
space:
mode:
Diffstat (limited to 'advtrains')
-rw-r--r--advtrains/occupation.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/advtrains/occupation.lua b/advtrains/occupation.lua
index 6e14459..66a5a75 100644
--- a/advtrains/occupation.lua
+++ b/advtrains/occupation.lua
@@ -172,8 +172,9 @@ function o.check_collision(pos, train_id)
if ti~=train_id then
local idx = t[i+1]
local train = advtrains.trains[ti]
+
--atdebug("checking train",t[i],"index",idx,"<>",train.index,train.end_index)
- if idx >= train.end_index and idx <= train.index then
+ if train and idx >= train.end_index and idx <= train.index then
--atdebug("collides.")
return true
end