summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2013-11-08 21:27:56 +0000
committerrubidium <rubidium@openttd.org>2013-11-08 21:27:56 +0000
commit1ffcdbd515667baee080a335bb8a2fd6825bd07e (patch)
treea72e523601a49eefb4bfc8f5a0489febd6d092be /src/saveload
parenta7fd0f8f5d18c23ee93f17f4b3f64e896203433e (diff)
downloadopenttd-1ffcdbd515667baee080a335bb8a2fd6825bd07e.tar.xz
(svn r25954) -Fix [FS#5731]: All semaphores got converted to electric signals when loading savegames from v15 to v20 (adf88)
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/afterload.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index 203a492a1..a3830a76b 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -1225,11 +1225,15 @@ bool AfterLoadGame()
switch (GetTileType(t)) {
case MP_RAILWAY:
if (HasSignals(t)) {
+ /* Original signal type/variant was stored in m4 but since saveload
+ * version 48 they are in m2. The bits has been already moved to m2
+ * (see the code somewhere above) so don't use m4, use m2 instead. */
+
/* convert PBS signals to combo-signals */
- if (HasBit(_m[t].m2, 2)) SetSignalType(t, TRACK_X, SIGTYPE_COMBO);
+ if (HasBit(_m[t].m2, 2)) SB(_m[t].m2, 0, 2, SIGTYPE_COMBO);
/* move the signal variant back */
- SetSignalVariant(t, TRACK_X, HasBit(_m[t].m2, 3) ? SIG_SEMAPHORE : SIG_ELECTRIC);
+ SB(_m[t].m2, 2, 1, HasBit(_m[t].m2, 3) ? SIG_SEMAPHORE : SIG_ELECTRIC);
ClrBit(_m[t].m2, 3);
}