Saveload: Add special proc op for whether to save chunk

This commit is contained in:
Jonathan G Rennison
2023-03-21 18:57:50 +00:00
parent b4f32e44d9
commit a57a909deb
2 changed files with 6 additions and 0 deletions

View File

@@ -2310,6 +2310,10 @@ static void SlSaveChunk(const ChunkHandler &ch)
/* Don't save any chunk information if there is no save handler. */
if (proc == nullptr) return;
if (ch.special_proc != nullptr) {
if (ch.special_proc(ch.id, CSLSO_SHOULD_SAVE_CHUNK) == CSLSOR_DONT_SAVE_CHUNK) return;
}
SlWriteUint32(ch.id);
DEBUG(sl, 2, "Saving chunk %c%c%c%c", ch.id >> 24, ch.id >> 16, ch.id >> 8, ch.id);