summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-10-02 00:23:30 +0000
committerrubidium <rubidium@openttd.org>2008-10-02 00:23:30 +0000
commitbdd756b58c208b3dd004c5dfde5ce0ae7fd58c82 (patch)
tree4b3464beaeb31db29a303786110d92a49f8b0e6b
parentd19d6f21a0810f80ebc8bae8ea283e06038bb000 (diff)
downloadopenttd-bdd756b58c208b3dd004c5dfde5ce0ae7fd58c82.tar.xz
(svn r14432) -Fix: tile description of tiles with only one signal that is not the normal signal showing "normal signal and <signal type on tile>".
-rw-r--r--src/rail_cmd.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index 0ae096163..ee0e09664 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -2399,7 +2399,16 @@ static void GetTileDesc_Track(TileIndex tile, TileDesc *td)
}
};
- td->str = signal_type[GetSignalType(tile, TRACK_UPPER)][GetSignalType(tile, TRACK_LOWER)];
+ uint primary_signal;
+ uint secondary_signal;
+ if (HasSignalOnTrack(tile, TRACK_UPPER)) {
+ primary_signal = GetSignalType(tile, TRACK_UPPER);
+ secondary_signal = HasSignalOnTrack(tile, TRACK_LOWER) ? GetSignalType(tile, TRACK_LOWER) : primary_signal;
+ } else {
+ secondary_signal = primary_signal = GetSignalType(tile, TRACK_LOWER);
+ }
+
+ td->str = signal_type[secondary_signal][primary_signal];
break;
}