Codechange: mark chunks that are not stored as CH_READONLY
This makes it easier to spot chunks that have a save_proc that is a nullptr, but also prevents confusion, where it looks like the CH_ type of a chunk has influence on how it is being read. It is not, it is only used for saving.
This commit is contained in:

committed by
Patric Stout

parent
4c4b55ecbd
commit
8e91527251
@@ -1897,10 +1897,10 @@ static void SlLoadCheckChunk(const ChunkHandler &ch)
|
||||
*/
|
||||
static void SlSaveChunk(const ChunkHandler &ch)
|
||||
{
|
||||
ChunkSaveLoadProc *proc = ch.save_proc;
|
||||
if (ch.type == CH_READONLY) return;
|
||||
|
||||
/* Don't save any chunk information if there is no save handler. */
|
||||
if (proc == nullptr) return;
|
||||
ChunkSaveLoadProc *proc = ch.save_proc;
|
||||
assert(proc != nullptr);
|
||||
|
||||
SlWriteUint32(ch.id);
|
||||
Debug(sl, 2, "Saving chunk {:c}{:c}{:c}{:c}", ch.id >> 24, ch.id >> 16, ch.id >> 8, ch.id);
|
||||
|
Reference in New Issue
Block a user