mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-07 04:17:13 +00:00
fix: write model behaviors only for property and inventory models
The client makes the mutable model component, which reads the behaviors and editing info, only when the object's config has propertyObjectID or inInventory (ObjectLoader2::LoadModelBehaviorsComponent); every other model gets the plain one, which reads only the model block. Writing the behaviors for every model made the client read them as the next component's data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -156,6 +156,11 @@ void ModelComponent::Serialize(RakNet::BitStream& outBitStream, bool bIsInitialU
|
||||
outBitStream.Write(m_OriginalPosition); // Original position
|
||||
outBitStream.Write(m_OriginalRotation); // Original rotation
|
||||
|
||||
// The client makes the mutable model component, which reads the behaviors and editing info, only for objects whose
|
||||
// config (the settings sent with a model) has propertyObjectID or inInventory; the plain one it makes for every
|
||||
// other model reads only the block above, as live wrote it
|
||||
if (!m_Parent->HasVar(u"propertyObjectID") && !m_Parent->GetVar<bool>(u"inInventory")) return;
|
||||
|
||||
outBitStream.Write1(); // We are writing behavior info
|
||||
outBitStream.Write<uint32_t>(m_Behaviors.size()); // Number of behaviors
|
||||
outBitStream.Write(m_IsPaused); // Is this model paused
|
||||
|
||||
Reference in New Issue
Block a user