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

Function SlObject

src/saveload/saveload.cpp:1846–1857  ·  view source on GitHub ↗

* Main SaveLoad function. * @param object The object that is being saved or loaded. * @param slt The SaveLoad table with objects to save/load. */

Source from the content-addressed store, hash-verified

1844 * @param slt The SaveLoad table with objects to save/load.
1845 */
1846void SlObject(void *object, const SaveLoadTable &slt)
1847{
1848 /* Automatically calculate the length? */
1849 if (_sl.need_length != NL_NONE) {
1850 SlSetLength(SlCalcObjLength(object, slt));
1851 if (_sl.need_length == NL_CALCLENGTH) return;
1852 }
1853
1854 for (auto &sld : slt) {
1855 SlObjectMember(object, sld);
1856 }
1857}
1858
1859/**
1860 * Handler that is assigned when there is a struct read in the savegame which

Callers 15

SaveObjectMethod · 0.85
SaveEmptyMethod · 0.85
SaveMethod · 0.85
LoadObjectsMethod · 0.85
LoadEmptyMethod · 0.85
LoadMethod · 0.85
SaveMethod · 0.85
LoadMethod · 0.85
SaveMethod · 0.85
LoadMethod · 0.85
SaveMethod · 0.85
LoadMethod · 0.85

Calls 3

SlSetLengthFunction · 0.85
SlCalcObjLengthFunction · 0.85
SlObjectMemberFunction · 0.85

Tested by

no test coverage detected