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

Function LoadTTDMain

src/saveload/oldloader_sl.cpp:1797–1828  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1795};
1796
1797bool LoadTTDMain(LoadgameState &ls)
1798{
1799 Debug(oldloader, 3, "Reading main chunk...");
1800
1801 _read_ttdpatch_flags = false;
1802
1803 /* Load the biggest chunk */
1804 if (!LoadChunk(ls, nullptr, main_chunk)) {
1805 Debug(oldloader, 0, "Loading failed");
1806 return false;
1807 }
1808
1809 Debug(oldloader, 3, "Done, converting game data...");
1810
1811 FixTTDMapArray();
1812 FixTTDDepots();
1813
1814 /* Fix some general stuff */
1815 if (to_underlying(_settings_game.game_creation.landscape) >= NUM_LANDSCAPE) _settings_game.game_creation.landscape = LandscapeType::Temperate;
1816
1817 /* Fix the game to be compatible with OpenTTD */
1818 FixOldTowns();
1819 FixOldVehicles(ls);
1820
1821 /* We have a new difficulty setting */
1822 _settings_game.difficulty.town_council_tolerance = Clamp(_old_diff_level, 0, 2);
1823
1824 Debug(oldloader, 3, "Finished converting game data");
1825 Debug(oldloader, 1, "TTD(Patch) savegame successfully converted");
1826
1827 return true;
1828}
1829
1830bool LoadTTOMain(LoadgameState &ls)
1831{

Callers

nothing calls this directly

Calls 7

LoadChunkFunction · 0.85
FixTTDMapArrayFunction · 0.85
FixTTDDepotsFunction · 0.85
to_underlyingFunction · 0.85
FixOldTownsFunction · 0.85
FixOldVehiclesFunction · 0.85
ClampFunction · 0.85

Tested by

no test coverage detected