mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 19:03:43 +00:00
Live wrote the item component's UGC info on every construction of an object with an item component (99 of 99 constructions of LOT 14535, a possessable with item, skill and controllable physics and no Objects row: ug_id 0, moderation status NoStatus, no description). DLU wrote a 0 bit. The item component is read after the skill and base-combat-AI components (ComponentOrderVector::Initialize 0x0101f8e0; live constructions of LOT 14535 have Skill then Item). DLU wrote it before the inventory, which did not show while it was a single 0 bit next to the skill's 0 bit, but would misalign every component after it now that it writes more. It now comes after BASE_COMBAT_AI. The ReplicaComponentOrderTests oracle moves the item the same way (intended change). Test: ReplicaConstructionTest.ItemConstructionWritesEmptyUgcInfo, ReplicaComponentOrderTest.EveryListedComponent (oracle updated). Check in game: with a second player watching, use a possessable / mount / vehicle item (e.g. a racing car in the race lobby); it appears, moves and is left normally for both. Rocket launches and property models look as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13 lines
517 B
C++
13 lines
517 B
C++
#include "ItemComponent.h"
|
|
|
|
void ItemComponent::Serialize(RakNet::BitStream& outBitStream, bool isConstruction) {
|
|
// Live wrote the user-generated-content info on every construction of an object with only an item component:
|
|
// no UGC id, moderation status NoStatus, no description.
|
|
outBitStream.Write(isConstruction);
|
|
if (isConstruction) {
|
|
outBitStream.Write<LWOOBJID>(LWOOBJID_EMPTY); // ug_id
|
|
outBitStream.Write<uint32_t>(0); // ug_moderation_status NoStatus
|
|
outBitStream.Write0(); // ug_description
|
|
}
|
|
}
|