fix(level): find a scene file's chunks and sections as the client does

SceneLoader::ReadLvlFile (1.10.64):
- chunked files: the file info chunk starts the file and gives where
  the environment, object and particle chunks start, 0 for none
  (DoLvlChunk, ReadLvlChunk1000); the reader walked the chunks one after
  another by their sizes instead;
- older files: the editor settings are a u32 size and that many bytes
  (SceneLoader::ReadEditorSettings, skipped by size); the reader took
  them for a u32 and then a count of 12 byte points;
- older files before version 3 have no objects for the client ("Level
  file is unsupported").

LevelFile now does the same. Every scene file on disk reads the same
objects as before.

Check in game: every world spawns its objects as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-29 06:26:11 -05:00
parent 96d73c30a4
commit 458fb601c9
6 changed files with 134 additions and 93 deletions

View File

@@ -62,6 +62,7 @@ struct LevelFile {
void Read(std::istream& file);
private:
static ChunkHeader ReadChunkHeader(std::istream& file, uint32_t start);
void ReadFileInfoChunk(std::istream& file, ChunkHeader& header);
void ReadSceneObjectDataChunk(std::istream& file, uint32_t version);
};