diff options
author | orwell96 <mono96.mml@gmail.com> | 2016-07-04 12:12:59 +0200 |
---|---|---|
committer | orwell96 <mono96.mml@gmail.com> | 2016-07-04 12:12:59 +0200 |
commit | 8c34eb0b1d1de44539e1e68f067c2b72e9b9914d (patch) | |
tree | 0675052bb7952d287d2eed3089d9ab14759dd467 | |
parent | 78b5520a88f18ebff3e5d15bc5389f2c80e3df83 (diff) | |
download | advtrains-8c34eb0b1d1de44539e1e68f067c2b72e9b9914d.tar.gz advtrains-8c34eb0b1d1de44539e1e68f067c2b72e9b9914d.tar.bz2 advtrains-8c34eb0b1d1de44539e1e68f067c2b72e9b9914d.zip |
Hopefully fix collision finally (fix mistake)
-rw-r--r-- | trainlogic.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/trainlogic.lua b/trainlogic.lua index f8f8796..0cecc39 100644 --- a/trainlogic.lua +++ b/trainlogic.lua @@ -588,9 +588,9 @@ function advtrains.try_connect_trains_and_check_collision(id1, id2) return end if vector.distance(testpos, frontpos1) < 0.5 then - local v2_sign = math.sign(i - ((train2.index-0.5) - ( (train2.index-0.5)-(advtrains.get_train_end_index(train2)+0.5) / 2 ))) + --local v2_sign = math.sign(i - ((train2.index-0.5) - ( (train2.index-0.5)-(advtrains.get_train_end_index(train2)+0.5) / 2 ))) train1.velocity=-1 - train2.velocity=advtrains.trains_facing(train1, train2) and -1 or 1 + train2.velocity=advtrains.trains_facing(train1, train2) and 1 or -1 train1.recently_collided_with_env=true train2.recently_collided_with_env=true return |