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

Function LoadWithFilter

src/saveload/saveload.cpp:3238–3247  ·  view source on GitHub ↗

* Load the game using a (reader) filter. * @param reader The filter to read the savegame from. * @return Return the result of the action. #SL_OK or #SL_REINIT ("unload" the game) */

Source from the content-addressed store, hash-verified

3236 * @return Return the result of the action. #SL_OK or #SL_REINIT ("unload" the game)
3237 */
3238SaveOrLoadResult LoadWithFilter(std::shared_ptr<LoadFilter> reader)
3239{
3240 try {
3241 _sl.action = SLA_LOAD;
3242 return DoLoad(std::move(reader), false);
3243 } catch (...) {
3244 ClearSaveLoadState();
3245 return SL_REINIT;
3246 }
3247}
3248
3249/**
3250 * Main Save or Load function where the high-level saveload functions are

Callers 1

SafeLoadFunction · 0.85

Calls 2

DoLoadFunction · 0.85
ClearSaveLoadStateFunction · 0.85

Tested by

no test coverage detected