mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-19 10:15:27 +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:
@@ -103,7 +103,7 @@ namespace {
|
||||
WriteFloats(stream, { 4.0f, 5.0f, 6.0f }); // position
|
||||
WriteFloats(stream, { 1.0f, 0.0f, 0.0f, 0.0f }); // rotation, w first
|
||||
WriteWString32(stream, names);
|
||||
if (version < 46) Write<uint16_t>(stream, 9);
|
||||
if (version < 46) Write<uint16_t>(stream, 0); // the names' wide null
|
||||
else WriteWString32(stream, config);
|
||||
}
|
||||
|
||||
@@ -286,7 +286,6 @@ TEST(LevelTests, ReadsAFileFromBeforeChunks) {
|
||||
EXPECT_EQ(level.sounds[0].config.find(u"soundName")->second->GetValueAsString(), "birds");
|
||||
ASSERT_EQ(level.particles.size(), 1);
|
||||
EXPECT_EQ(level.particles[0].priority, 0); // only from version 43
|
||||
EXPECT_EQ(level.particles[0].unknown, 9);
|
||||
}
|
||||
|
||||
// Older lighting: fog distances only before 39, no directional colour before 36, and before 33 a fixed spawn point
|
||||
|
||||
Reference in New Issue
Block a user