Fix bridges not being redrawn after all signals reset when cleared

This commit is contained in:
Jonathan G Rennison
2021-01-05 01:04:52 +00:00
parent 65d5d13a08
commit d32a282112
3 changed files with 20 additions and 7 deletions

View File

@@ -107,17 +107,22 @@ void SetBridgeEntranceSimulatedSignalStateExtended(TileIndex t, uint16 signal, S
_m[t].m2 |= BRIDGE_M2_SIGNAL_STATE_EXT_FLAG;
}
void SetAllBridgeEntranceSimulatedSignalsGreenExtended(TileIndex t)
bool SetAllBridgeEntranceSimulatedSignalsGreenExtended(TileIndex t)
{
bool changed = GB(_m[t].m2, BRIDGE_M2_SIGNAL_STATE_OFFSET, BRIDGE_M2_SIGNAL_STATE_COUNT) != 0;
SB(_m[t].m2, BRIDGE_M2_SIGNAL_STATE_OFFSET, BRIDGE_M2_SIGNAL_STATE_FIELD_SIZE, 0);
auto it = _long_bridge_signal_sim_map.find(t);
if (it != _long_bridge_signal_sim_map.end()) {
LongBridgeSignalStorage &lbss = it->second;
for (auto &it : lbss.signal_red_bits) {
it = 0;
if (it != 0) {
changed = true;
it = 0;
}
}
_m[t].m2 |= BRIDGE_M2_SIGNAL_STATE_EXT_FLAG;
}
return changed;
}
void ClearBridgeEntranceSimulatedSignalsExtended(TileIndex t)