mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-16 08:45:27 +00:00
fix: write a collectible's id on construction only
LWOCollectibleComponent::Deserialize (0x00c45ec0) reads the 16-bit id on construction and nothing on an update. DLU wrote the id on every serialization, so the client read 16 stray bits as the flag bits of the components after it. The replica decoder follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -389,7 +389,8 @@ namespace {
|
||||
}
|
||||
if (r.Bit()) j["onThreatList"] = r.Bit();
|
||||
} },
|
||||
{ COLLECTIBLE, [](Reader& r, json& j, bool, const auto&) { j["collectibleID"] = r.Get<int16_t>(); } },
|
||||
// LWOCollectibleComponent::Deserialize: the id on construction only
|
||||
{ COLLECTIBLE, [](Reader& r, json& j, bool initial, const auto&) { if (initial) j["collectibleID"] = r.Get<int16_t>(); } },
|
||||
// LWOPetComponent::Deserialize: everything under the dirty bit, the names on updates too
|
||||
{ PET, [](Reader& r, json& j, bool, const auto&) {
|
||||
if (!r.Bit()) return;
|
||||
|
||||
Reference in New Issue
Block a user