summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-06-10 16:02:00 +0000
committersmatz <smatz@openttd.org>2009-06-10 16:02:00 +0000
commit5a6bb538940beed2ef01055481f7ead565625833 (patch)
treedd6f2e8553e187fbf31095a2e1c403157a240a18 /src/saveload
parent5e1c59c3de00e594e7627359588eb66e7ef69511 (diff)
downloadopenttd-5a6bb538940beed2ef01055481f7ead565625833.tar.xz
(svn r16553) -Codechange: don't use TRACK_BIT_WORMHOLE and TRACK_BIT_DEPOT as bitmasks
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/afterload.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index 9ec6b231a..2ff9b1667 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -1700,10 +1700,15 @@ bool AfterLoadGame()
if (CheckSavegameVersion(101)) {
Train *t;
FOR_ALL_TRAINS(t) {
- if ((t->track & TRACK_BIT_WORMHOLE) == TRACK_BIT_WORMHOLE) {
- TryReserveRailTrack(t->tile, DiagDirToDiagTrack(GetTunnelBridgeDirection(t->tile)));
- } else if ((t->track & TRACK_BIT_MASK) != TRACK_BIT_NONE) {
- TryReserveRailTrack(t->tile, TrackBitsToTrack(t->track));
+ switch (t->track) {
+ case TRACK_BIT_WORMHOLE:
+ TryReserveRailTrack(t->tile, DiagDirToDiagTrack(GetTunnelBridgeDirection(t->tile)));
+ break;
+ case TRACK_BIT_DEPOT:
+ break;
+ default:
+ TryReserveRailTrack(t->tile, TrackBitsToTrack(t->track));
+ break;
}
}
}