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

Function SlGetStructListLength

src/saveload/saveload.cpp:1833–1839  ·  view source on GitHub ↗

* Get the length of this list; if it exceeds the limit, error out. * @param limit The maximum size the list can be. * @return The length of the list. */

Source from the content-addressed store, hash-verified

1831 * @return The length of the list.
1832 */
1833size_t SlGetStructListLength(size_t limit)
1834{
1835 size_t length = SlReadArrayLength();
1836 if (length > limit) SlErrorCorrupt("List exceeds storage size");
1837
1838 return length;
1839}
1840
1841/**
1842 * Main SaveLoad function.

Callers 15

LoadMethod · 0.85
SlObjectMemberFunction · 0.85
LoadMethod · 0.85
LoadMethod · 0.85
LoadMethod · 0.85
LoadMethod · 0.85
GetLengthMethod · 0.85
GetNumCargoMethod · 0.85
LoadMethod · 0.85
LoadMethod · 0.85
GetLengthMethod · 0.85
LoadMethod · 0.85

Calls 2

SlReadArrayLengthFunction · 0.85
SlErrorCorruptFunction · 0.85

Tested by

no test coverage detected