mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-18 01:35:27 +00:00
fix: constructions keep pending health, quick build and equipment changes
The destroyable's health and threat blocks, the quick build's state and the inventory's equipped items are each read behind a flag bit (LWODestroyableComponent::Deserialize 0x00d2bbd0 and the others). DLU cleared their dirty flags when it wrote a construction, which goes only to the client the object came into range of, so a change waiting for the next update never reached the clients already watching: a health bar, a quick build's state, a player's new gear. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -700,6 +700,11 @@ TEST_F(InventoryConstructionTest, NpcItemsLikeLive) {
|
||||
coleExpected.Write<uint32_t>(0);
|
||||
ExpectSameBits(coleConstruction, coleExpected);
|
||||
|
||||
// The equipment put on before the construction still goes to the clients already watching, once
|
||||
RakNet::BitStream pending;
|
||||
coleInventory->Serialize(pending, false);
|
||||
EXPECT_GT(pending.GetNumberOfBitsUsed(), 2u);
|
||||
|
||||
// A serialization with nothing changed writes neither list
|
||||
RakNet::BitStream serialization;
|
||||
coleInventory->Serialize(serialization, false);
|
||||
|
||||
Reference in New Issue
Block a user