mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-15 16:27:14 +00:00
fix: skip the wide null after a scene file particle's effect names
Before version 46 the u16 after a particle's effect names is the names' wide null terminator, 0 in every shipped scene file. It is skipped instead of kept as an unknown value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -291,8 +291,13 @@ void LevelFile::ReadParticles(std::istream& file) {
|
||||
BinaryIO::BinaryRead(file, particle.position);
|
||||
BinaryIO::BinaryRead(file, particle.rotation);
|
||||
particle.effectNames = ReadWideString32(file);
|
||||
if (version < 46) BinaryIO::BinaryRead(file, particle.unknown);
|
||||
else config = ReadWideString32(file);
|
||||
if (version < 46) {
|
||||
// Before version 46 the effect names end with a wide null
|
||||
uint16_t nameTerminator{};
|
||||
BinaryIO::BinaryRead(file, nameTerminator);
|
||||
} else {
|
||||
config = ReadWideString32(file);
|
||||
}
|
||||
particle.config = config;
|
||||
if (file.fail()) throw std::runtime_error("Failed to read from istream.");
|
||||
// The client stops at a particle with no effect
|
||||
|
||||
Reference in New Issue
Block a user