mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-18 09:45:28 +00:00
fix: constructions keep pending changes of five more components
The level, forced movement, possessable, possessor and combat AI parts are each read behind a flag bit (LWOLevelProgressionComponent:: Deserialize 0x00c63bd0 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 level up, a mount or dismount, a rail ride. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -41,7 +41,8 @@ void LevelProgressionComponent::LoadFromSaveData(const tinyxml2::XMLDocument& do
|
||||
void LevelProgressionComponent::Serialize(RakNet::BitStream& outBitStream, bool bIsInitialUpdate) {
|
||||
outBitStream.Write(bIsInitialUpdate || m_DirtyLevelInfo);
|
||||
if (bIsInitialUpdate || m_DirtyLevelInfo) outBitStream.Write(m_Level);
|
||||
m_DirtyLevelInfo = false;
|
||||
// A construction goes to one client; the players already watching still need a waiting change
|
||||
if (!bIsInitialUpdate) m_DirtyLevelInfo = false;
|
||||
}
|
||||
|
||||
void LevelProgressionComponent::HandleLevelUp() {
|
||||
|
||||
@@ -14,7 +14,7 @@ void PlayerForcedMovementComponent::Serialize(RakNet::BitStream& outBitStream, b
|
||||
outBitStream.Write(m_PlayerOnRail);
|
||||
outBitStream.Write(m_ShowBillboard);
|
||||
}
|
||||
m_DirtyInfo = false;
|
||||
if (!bIsInitialUpdate) m_DirtyInfo = false;
|
||||
}
|
||||
|
||||
void PlayerForcedMovementComponent::Allocator(Entity& entity, ObjectLoadState& state) {
|
||||
|
||||
@@ -38,7 +38,7 @@ PossessorComponent::~PossessorComponent() {
|
||||
void PossessorComponent::Serialize(RakNet::BitStream& outBitStream, bool bIsInitialUpdate) {
|
||||
outBitStream.Write(m_DirtyPossesor || bIsInitialUpdate);
|
||||
if (m_DirtyPossesor || bIsInitialUpdate) {
|
||||
m_DirtyPossesor = false;
|
||||
if (!bIsInitialUpdate) m_DirtyPossesor = false;
|
||||
outBitStream.Write(m_Possessable != LWOOBJID_EMPTY);
|
||||
if (m_Possessable != LWOOBJID_EMPTY) {
|
||||
outBitStream.Write(m_Possessable);
|
||||
|
||||
Reference in New Issue
Block a user