Progsig: Fix various issues with removing program dependencies.
Fix RemoveProgramDependencies using one parameter for both source and target, and rename the parameters to something sensible. Update program window when invalidating in RemoveProgramDependencies. Make SignalStateCondition::IsSignalValid const and add CheckSignalValid for non-const validaty checking.
This commit is contained in:
@@ -768,11 +768,11 @@ void CheckRemoveSignalsFromTile(TileIndex tile)
|
||||
}
|
||||
}
|
||||
|
||||
static void NotifyRemovingDependentSignal(SignalReference on, SignalReference by)
|
||||
static void NotifyRemovingDependentSignal(SignalReference being_removed, SignalReference dependant)
|
||||
{
|
||||
SignalType t = GetSignalType(by.tile, by.track);
|
||||
SignalType t = GetSignalType(dependant.tile, dependant.track);
|
||||
if (IsProgrammableSignal(t)) {
|
||||
RemoveProgramDependencies(by, on);
|
||||
RemoveProgramDependencies(being_removed, dependant);
|
||||
} else {
|
||||
DEBUG(misc, 0, "Removing dependency held by non-programmable signal (Unexpected)");
|
||||
}
|
||||
|
Reference in New Issue
Block a user