From 7893185cad053719b0df41747a20a41f064b4d0c Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Tue, 10 Nov 2026 13:22:59 -0600 Subject: [PATCH] fix: write a trigger object's trigger component as live did The client makes the trigger component of an object whose header sets the trigger bit after all the others, and reads it last: LWOTriggerComponent::Deserialize (0x00bd78c0) takes a flag bit and a 32-bit pick type. Every live construction of a trigger object ended with the flag and -1 (4,533 of 4,533); DLU wrote nothing, which the client read as no flag. Nothing changes for the player: -1 is the client's default. Co-Authored-By: Claude Opus 5.5 --- dGame/Entity.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dGame/Entity.cpp b/dGame/Entity.cpp index 73b5f309e..633ec41e0 100644 --- a/dGame/Entity.cpp +++ b/dGame/Entity.cpp @@ -810,6 +810,16 @@ void Entity::WriteComponents(RakNet::BitStream& outBitStream, eReplicaPacketType } component->Serialize(outBitStream, bIsInitialUpdate); } + + // The client makes the trigger component of an object whose header sets the trigger bit after the others, so it is + // read last. LWOTriggerComponent::Deserialize (0x00bd78c0): a flag and the pick type; live constructions carried + // the flag and -1 (no pick type). + const auto* const triggerComponent = GetComponent(); + const auto* const trigger = triggerComponent ? triggerComponent->GetTrigger() : nullptr; + if (trigger && !trigger->events.empty()) { + outBitStream.Write(bIsInitialUpdate); + if (bIsInitialUpdate) outBitStream.Write(-1); + } } void Entity::UpdateXMLDoc(tinyxml2::XMLDocument& doc) {