aboutsummaryrefslogtreecommitdiff
path: root/advtrains/wagons.lua
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2019-12-01 12:09:04 +0100
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2019-12-01 12:09:04 +0100
commit0518fbbf3ae388631cb21f238068f2a6b3785972 (patch)
tree0a70cd4c3a480d32af005f7e1b67cd0e1c30976f /advtrains/wagons.lua
parentb71c72b4ab4d50c8f3a3a6ccbe15427548e1d2ff (diff)
parent2157a7ef365902162336540d89d91049c5d3a394 (diff)
downloadadvtrains-0518fbbf3ae388631cb21f238068f2a6b3785972.tar.gz
advtrains-0518fbbf3ae388631cb21f238068f2a6b3785972.tar.bz2
advtrains-0518fbbf3ae388631cb21f238068f2a6b3785972.zip
Merge branch 'master' of https://git.bananach.space/advtrains
Diffstat (limited to 'advtrains/wagons.lua')
-rw-r--r--advtrains/wagons.lua15
1 files changed, 4 insertions, 11 deletions
diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua
index 924762c..4dbe85c 100644
--- a/advtrains/wagons.lua
+++ b/advtrains/wagons.lua
@@ -432,17 +432,10 @@ function wagon:on_step(dtime)
end
end
if collides then
- if self.collision_count and self.collision_count>10 then
- --enable collision mercy to get trains stuck in walls out of walls
- --actually do nothing except limiting the velocity to 1
- train.velocity=math.min(train.velocity, 1)
- else
- train.recently_collided_with_env=true
- train.velocity=0
- self.collision_count=(self.collision_count or 0)+1
- end
- else
- self.collision_count=nil
+ -- screw collision mercy
+ train.recently_collided_with_env=true
+ train.velocity=0
+ advtrains.atc.train_reset_command(train)
end
end