Use separate bits for signals on bridge/tunnel entrance/exit red/green states

This commit is contained in:
Jonathan G Rennison
2018-06-17 03:29:47 +01:00
parent 0dd3ff23de
commit d03139b241
10 changed files with 85 additions and 34 deletions

View File

@@ -2989,7 +2989,7 @@ bool AfterLoadGame()
/* signalled tunnel entrance */
SignalState state = HasBit(_m[t].m5, 6) ? SIGNAL_STATE_RED : SIGNAL_STATE_GREEN;
ClrBit(_m[t].m5, 6);
SetTunnelBridgeSignalState(t, state);
SetTunnelBridgeEntranceSignalState(t, state);
}
}
}
@@ -3005,6 +3005,14 @@ bool AfterLoadGame()
}
}
}
if (SlXvIsFeaturePresent(XSLFI_SIG_TUNNEL_BRIDGE, 1, 5)) {
/* entrance and exit signal red/green states now have separate bits */
for (TileIndex t = 0; t < map_size; t++) {
if (IsTileType(t, MP_TUNNELBRIDGE) && GetTunnelBridgeTransportType(t) == TRANSPORT_RAIL && IsTunnelBridgeSignalSimulationExit(t)) {
SetTunnelBridgeExitSignalState(t, HasBit(_me[t].m6, 0) ? SIGNAL_STATE_GREEN : SIGNAL_STATE_RED);
}
}
}
/* Station acceptance is some kind of cache */
if (IsSavegameVersionBefore(127)) {