* Main SaveLoad function. * @param object The object that is being saved or loaded. * @param slt The SaveLoad table with objects to save/load. */
| 1844 | * @param slt The SaveLoad table with objects to save/load. |
| 1845 | */ |
| 1846 | void 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 |