mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-15 16:27:14 +00:00
refactor(entity): components load their config and save after all exist, as the client
LWOGameObject::MakeReadyForSerialization runs each component's LoadConfigData and then a character's LoadFromSaveData, in the order the components were made, once DoObjectComponentLoad has made them all; then their Startup. Entity::Initialize now does the same with a component list in creation order (the client's componentList); the walk's own save calls (mission, physics, destroyable, level, character, skill, ghost) and the destroyable's call into the buff go. A model's behaviors load in its LoadConfigData; controllable physics places a non-character at construction, as the client's physics takes the spawn position. A component added later still loads at once. Same bytes for every LOT. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -51,18 +51,19 @@ ControllablePhysicsComponent::ControllablePhysicsComponent(Entity* entity, const
|
||||
m_ImmuneToStunMoveCount = 0;
|
||||
m_ImmuneToStunTurnCount = 0;
|
||||
m_ImmuneToStunUseItemCount = 0;
|
||||
|
||||
// An object that isn't a character starts where the level put it (from the object's spawn info, as the client's
|
||||
// physics does; a character's place comes with its save)
|
||||
if (!m_Parent->GetCharacter()) {
|
||||
SetPosition(m_Parent->GetDefaultPosition());
|
||||
SetRotation(m_Parent->GetDefaultRotation());
|
||||
}
|
||||
}
|
||||
|
||||
// After the physics config: a character's body, in the physics component's group
|
||||
void ControllablePhysicsComponent::LoadConfigData() {
|
||||
PhysicsComponent::LoadConfigData();
|
||||
|
||||
// An object that isn't a character starts where the level put it (a character's place comes with its save)
|
||||
if (!m_Parent->GetCharacter()) {
|
||||
SetPosition(m_Parent->GetDefaultPosition());
|
||||
SetRotation(m_Parent->GetDefaultRotation());
|
||||
}
|
||||
|
||||
if (m_Parent->GetLOT() != 1) // Other physics entities we care about will be added by BaseCombatAI
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user