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

Function SlLoadCheckChunks

src/saveload/saveload.cpp:2326–2338  ·  view source on GitHub ↗

Load all chunks for savegame checking */

Source from the content-addressed store, hash-verified

2324
2325/** Load all chunks for savegame checking */
2326static void SlLoadCheckChunks()
2327{
2328 uint32_t id;
2329 const ChunkHandler *ch;
2330
2331 for (id = SlReadUint32(); id != 0; id = SlReadUint32()) {
2332 Debug(sl, 2, "Loading chunk {:c}{:c}{:c}{:c}", id >> 24, id >> 16, id >> 8, id);
2333
2334 ch = SlFindChunkHandler(id);
2335 if (ch == nullptr) SlErrorCorrupt("Unknown chunk type");
2336 SlLoadCheckChunk(*ch);
2337 }
2338}
2339
2340/** Fix all pointers (convert index -> pointer) */
2341static void SlFixPointers()

Callers 1

DoLoadFunction · 0.85

Calls 4

SlReadUint32Function · 0.85
SlFindChunkHandlerFunction · 0.85
SlErrorCorruptFunction · 0.85
SlLoadCheckChunkFunction · 0.85

Tested by

no test coverage detected