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

Function SlSetStructListLength

src/saveload/saveload.cpp:1817–1826  ·  view source on GitHub ↗

* Set the length of this list. * @param The length of the list. */

Source from the content-addressed store, hash-verified

1815 * @param The length of the list.
1816 */
1817void SlSetStructListLength(size_t length)
1818{
1819 /* Automatically calculate the length? */
1820 if (_sl.need_length != NL_NONE) {
1821 SlSetLength(SlGetArrayLength(length));
1822 if (_sl.need_length == NL_CALCLENGTH) return;
1823 }
1824
1825 SlWriteArrayLength(length);
1826}
1827
1828/**
1829 * Get the length of this list; if it exceeds the limit, error out.

Callers 15

SaveMethod · 0.85
SlObjectMemberFunction · 0.85
SaveMethod · 0.85
SaveMethod · 0.85
SaveMethod · 0.85
SaveMethod · 0.85
SaveMethod · 0.85
SaveMethod · 0.85
SaveMethod · 0.85
SaveMethod · 0.85
SaveMethod · 0.85
SaveMethod · 0.85

Calls 3

SlSetLengthFunction · 0.85
SlGetArrayLengthFunction · 0.85
SlWriteArrayLengthFunction · 0.85

Tested by

no test coverage detected