diff options
author | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2019-12-01 12:09:04 +0100 |
---|---|---|
committer | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2019-12-01 12:09:04 +0100 |
commit | 0518fbbf3ae388631cb21f238068f2a6b3785972 (patch) | |
tree | 0a70cd4c3a480d32af005f7e1b67cd0e1c30976f /advtrains/wagons.lua | |
parent | b71c72b4ab4d50c8f3a3a6ccbe15427548e1d2ff (diff) | |
parent | 2157a7ef365902162336540d89d91049c5d3a394 (diff) | |
download | advtrains-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.lua | 15 |
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
|