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

Method AskRemoveAllIndustriesCallback

src/industry_gui.cpp:614–628  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

612 }
613
614 static void AskRemoveAllIndustriesCallback(Window *, bool confirmed)
615 {
616 if (!confirmed) return;
617
618 for (Industry *industry : Industry::Iterate()) delete industry;
619
620 /* Clear farmland. */
621 for (const auto tile : Map::Iterate()) {
622 if (IsTileType(tile, MP_CLEAR) && GetClearGround(tile) == CLEAR_FIELDS) {
623 MakeClear(tile, CLEAR_GRASS, 3);
624 }
625 }
626
627 MarkWholeScreenDirty();
628 }
629
630 void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override
631 {

Callers

nothing calls this directly

Calls 4

IsTileTypeFunction · 0.85
GetClearGroundFunction · 0.85
MakeClearFunction · 0.85
MarkWholeScreenDirtyFunction · 0.85

Tested by

no test coverage detected