mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-20 10:45:27 +00:00
fix(entity): send updatesWithParentPosition from the spawn behavior, as live
The parent info always said the object doesn't move with its parent. Live sent true for objects a spawn behavior made with updatePositionWithParent (all 70 Engineer Personal Fortress constructions in the captures, LOT 9479, and the Summoner's Scratch, 9644); the client then moves them with the player. Every other construction in the captures sent false, and none sent an object world state, which stays unsent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -370,6 +370,10 @@ public:
|
||||
// Scale will only be communicated to the client when the construction packet is sent
|
||||
void SetScale(const float scale) { m_Scale = scale; };
|
||||
|
||||
// The client moves the object with its parent (LWOGameObject::updatesWithParentPosition), sent with the parent;
|
||||
// the spawn behavior's updatePositionWithParent sets it (live: the Engineer Personal Fortress, LOT 9479)
|
||||
void SetUpdatesWithParentPosition(const bool value) { m_UpdatesWithParentPosition = value; m_IsParentChildDirty = true; }
|
||||
|
||||
// The zone scene the object was placed in (EntityInfo::scene), -1 when it came from none
|
||||
int32_t GetScene() const { return m_Scene; }
|
||||
|
||||
@@ -466,6 +470,7 @@ private:
|
||||
int8_t m_Observers = 0;
|
||||
|
||||
bool m_IsParentChildDirty = true;
|
||||
bool m_UpdatesWithParentPosition = false;
|
||||
|
||||
// When this object was created on this server. Construction sends its age from this, as live did.
|
||||
std::chrono::steady_clock::time_point m_CreationTime = std::chrono::steady_clock::now();
|
||||
|
||||
Reference in New Issue
Block a user