diff options
author | michi_cc <michi_cc@openttd.org> | 2010-02-28 08:18:20 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2010-02-28 08:18:20 +0000 |
commit | eae120361dc58d8f8cbea89ec19841a243bf0eda (patch) | |
tree | 2d446f7ae8fe1526e316180bc6057f570f2bfa62 | |
parent | a19e6ff9747f9310c4b39ed3496b0a994674d263 (diff) | |
download | openttd-eae120361dc58d8f8cbea89ec19841a243bf0eda.tar.xz |
(svn r19286) -Fix (r18648): [YAPP] If reversing at path signals was disabled, a train would not reverse when hitting the back of an one-way signal.
-rw-r--r-- | src/train_cmd.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 31c0eccad..5723f3d47 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -3364,8 +3364,11 @@ static void TrainController(Train *v, Vehicle *nomove) } /* If we would reverse but are currently in a PBS block and - * reversing of stuck trains is disabled, don't reverse. */ - if (_settings_game.pf.wait_for_pbs_path == 255 && UpdateSignalsOnSegment(v->tile, enterdir, v->owner) == SIGSEG_PBS) { + * reversing of stuck trains is disabled, don't reverse. + * This does not apply if the reason for reversing is a one-way + * signal blocking us, because a train would then be stuck forever. */ + if (_settings_game.pf.wait_for_pbs_path == 255 && !HasOnewaySignalBlockingTrackdir(gp.new_tile, i) && + UpdateSignalsOnSegment(v->tile, enterdir, v->owner) == SIGSEG_PBS) { v->wait_counter = 0; return; } |