mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 02:43:44 +00:00
fix(zone): spawner and camera paths have their fields only from version 4
The client reads a spawner path's fields (LOT, respawn time, counts, object ID) and a camera path's next path and rotate-player flag only when the path is newer than version 3 (LevelPath::FromBuffer, 1.10.64: pathVersion > 3). The reader read them for every version, which would misread an older spawner or camera path from there on. No zone file on disk has a spawner or camera path older than version 4, so what they read is unchanged. Check in game: nothing to check (no live zone changes). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -287,13 +287,13 @@ bool ZoneFile::ReadPath(std::istream& file) {
|
||||
BinaryIO::BinaryRead(file, path.property.playerZoneCoords);
|
||||
BinaryIO::BinaryRead(file, path.property.maxBuildHeight);
|
||||
}
|
||||
} else if (path.pathType == PathType::Camera) {
|
||||
} else if (path.pathType == PathType::Camera && path.pathVersion > 3) {
|
||||
BinaryIO::ReadString<uint8_t>(file, path.camera.nextPath, BinaryIO::ReadType::WideString);
|
||||
if (path.pathVersion >= 14) {
|
||||
BinaryIO::BinaryRead(file, path.camera.rotatePlayer);
|
||||
|
||||
}
|
||||
} else if (path.pathType == PathType::Spawner) {
|
||||
} else if (path.pathType == PathType::Spawner && path.pathVersion > 3) {
|
||||
BinaryIO::BinaryRead(file, path.spawner.spawnedLOT);
|
||||
BinaryIO::BinaryRead(file, path.spawner.respawnTime);
|
||||
BinaryIO::BinaryRead(file, path.spawner.maxToSpawn);
|
||||
|
||||
Reference in New Issue
Block a user