aboutsummaryrefslogtreecommitdiff
path: root/advtrains/occupation.lua
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2019-08-11 20:16:11 +0200
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2019-08-11 20:16:11 +0200
commit2d8c13885aa33a0f5eb43b16a1131f187fad75e7 (patch)
tree8bddf1888edfa105c613ba38a70aea05c4aa8334 /advtrains/occupation.lua
parentef50610f675c85cb0c85eb200018896cefd0cc11 (diff)
downloadadvtrains-2d8c13885aa33a0f5eb43b16a1131f187fad75e7.tar.gz
advtrains-2d8c13885aa33a0f5eb43b16a1131f187fad75e7.tar.bz2
advtrains-2d8c13885aa33a0f5eb43b16a1131f187fad75e7.zip
Shunting mode now couples trains on collision.
Trains now get coupled when one of them is in coupling mode.
Diffstat (limited to 'advtrains/occupation.lua')
-rw-r--r--advtrains/occupation.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/advtrains/occupation.lua b/advtrains/occupation.lua
index 66a5a75..f5c7d88 100644
--- a/advtrains/occupation.lua
+++ b/advtrains/occupation.lua
@@ -175,8 +175,8 @@ function o.check_collision(pos, train_id)
--atdebug("checking train",t[i],"index",idx,"<>",train.index,train.end_index)
if train and idx >= train.end_index and idx <= train.index then
- --atdebug("collides.")
- return true
+ --atdebug("collides.")
+ return train -- return train it collided with so we can couple when shunting is enabled
end
end
i = i + 2