mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-17 17:25:27 +00:00
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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<TriggerComponent>();
|
||||
const auto* const trigger = triggerComponent ? triggerComponent->GetTrigger() : nullptr;
|
||||
if (trigger && !trigger->events.empty()) {
|
||||
outBitStream.Write(bIsInitialUpdate);
|
||||
if (bIsInitialUpdate) outBitStream.Write<int32_t>(-1);
|
||||
}
|
||||
}
|
||||
|
||||
void Entity::UpdateXMLDoc(tinyxml2::XMLDocument& doc) {
|
||||
|
||||
Reference in New Issue
Block a user