MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / ClearLastVariant

Function ClearLastVariant

src/engine.cpp:635–640  ·  view source on GitHub ↗

* Ensure engine is not set as the last used variant for any other engine. * @param engine_id Engine being removed. * @param type Type of engine. */

Source from the content-addressed store, hash-verified

633 * @param type Type of engine.
634 */
635static void ClearLastVariant(EngineID engine_id, VehicleType type)
636{
637 for (Engine *e : Engine::IterateType(type)) {
638 if (e->display_last_variant == engine_id) e->display_last_variant = EngineID::Invalid();
639 }
640}
641
642/**
643 * Update #Engine::reliability and (if needed) update the engine GUIs.

Callers 2

CalcEngineReliabilityFunction · 0.85
DisableEngineForCompanyFunction · 0.85

Calls 1

InvalidFunction · 0.85

Tested by

no test coverage detected