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

Function SaveWithFilter

src/saveload/saveload.cpp:3078–3087  ·  view source on GitHub ↗

* Save the game using a (writer) filter. * @param writer The filter to write the savegame to. * @param threaded Whether to try to perform the saving asynchronously. * @return Return the result of the action. #SL_OK or #SL_ERROR */

Source from the content-addressed store, hash-verified

3076 * @return Return the result of the action. #SL_OK or #SL_ERROR
3077 */
3078SaveOrLoadResult SaveWithFilter(std::shared_ptr<SaveFilter> writer, bool threaded)
3079{
3080 try {
3081 _sl.action = SLA_SAVE;
3082 return DoSave(std::move(writer), threaded);
3083 } catch (...) {
3084 ClearSaveLoadState();
3085 return SL_ERROR;
3086 }
3087}
3088
3089/**
3090 * Determines the SaveLoadFormat that is connected to the given tag.

Callers 1

SendMapMethod · 0.85

Calls 2

DoSaveFunction · 0.85
ClearSaveLoadStateFunction · 0.85

Tested by

no test coverage detected