Fix engine changes not updating build template train windows

This commit is contained in:
Jonathan G Rennison
2022-11-27 20:22:28 +00:00
parent 5d171e0023
commit 2eecf19edb
5 changed files with 11 additions and 0 deletions

View File

@@ -627,7 +627,10 @@ static void CalcEngineReliability(Engine *e)
/* Kick this engine out of the lists */
RetireEngineIfPossible(e, e->duration_phase_1 + e->duration_phase_2 + e->duration_phase_3);
}
SetWindowClassesDirty(WC_BUILD_VEHICLE); // Update to show the new reliability
SetWindowClassesDirty(WC_BUILD_VIRTUAL_TRAIN);
SetWindowClassesDirty(WC_REPLACE_VEHICLE);
}
@@ -739,6 +742,7 @@ void StartupEngines()
/* Invalidate any open purchase lists */
InvalidateWindowClassesData(WC_BUILD_VEHICLE);
InvalidateWindowClassesData(WC_BUILD_VIRTUAL_TRAIN);
}
/**
@@ -1105,6 +1109,7 @@ void EnginesMonthlyLoop()
}
InvalidateWindowClassesData(WC_BUILD_VEHICLE); // rebuild the purchase list (esp. when sorted by reliability)
InvalidateWindowClassesData(WC_BUILD_VIRTUAL_TRAIN);
}
}