mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 14:27:16 +00:00
(svn r25953) -Fix [FS#5732]: Wrong bits used when converting signal types/variants while loading savegames older than v64 (adf88)
This commit is contained in:
parent
cdd6752ead
commit
a7fd0f8f5d
@ -1509,13 +1509,15 @@ bool AfterLoadGame()
|
||||
}
|
||||
|
||||
if (IsSavegameVersionBefore(64)) {
|
||||
/* copy the signal type/variant and move signal states bits */
|
||||
/* Since now we allow different signal types and variants on a single tile.
|
||||
* Move signal states to m4 to make room and clone the signal type/variant. */
|
||||
for (TileIndex t = 0; t < map_size; t++) {
|
||||
if (IsTileType(t, MP_RAILWAY) && HasSignals(t)) {
|
||||
/* move signal states */
|
||||
SetSignalStates(t, GB(_m[t].m2, 4, 4));
|
||||
SetSignalVariant(t, INVALID_TRACK, GetSignalVariant(t, TRACK_X));
|
||||
SetSignalType(t, INVALID_TRACK, GetSignalType(t, TRACK_X));
|
||||
ClrBit(_m[t].m2, 7);
|
||||
SB(_m[t].m2, 4, 4, 0);
|
||||
/* clone signal type and variant */
|
||||
SB(_m[t].m2, 4, 3, GB(_m[t].m2, 0, 3));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user