mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-18 13:28:09 +00:00
Rename some variables
- Add order for loading Components - Enforce all components have Entity* in the first argument
This commit is contained in:
@@ -96,14 +96,14 @@ Entity::Entity(const LWOOBJID& objectID, EntityInfo info, Entity* parentEntity)
|
||||
m_CollectibleID = 0;
|
||||
m_NetworkID = 0;
|
||||
m_Observers = 0;
|
||||
m_Groups = {};
|
||||
m_OwnerOverride = LWOOBJID_EMPTY;
|
||||
m_Timers = {};
|
||||
m_ChildEntities = {};
|
||||
m_Groups.clear();
|
||||
m_Timers.clear();
|
||||
m_ChildEntities.clear();
|
||||
m_TargetsInPhantom.clear();
|
||||
m_DieCallbacks.clear();
|
||||
m_PhantomCollisionCallbacks.clear();
|
||||
m_ScheduleKiller = nullptr;
|
||||
m_TargetsInPhantom = {};
|
||||
m_DieCallbacks = {};
|
||||
m_PhantomCollisionCallbacks = {};
|
||||
m_IsParentChildDirty = true;
|
||||
m_IsGhostingCandidate = false;
|
||||
m_PlayerIsReadyForUpdates = false;
|
||||
@@ -378,6 +378,23 @@ void Entity::Initialize() {
|
||||
Game::logger->Log("Entity", "blah %i %i", componentId, m_TemplateID);
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto&[componentId, component] : m_Components) {
|
||||
component->LoadTemplateData();
|
||||
}
|
||||
|
||||
for (const auto&[componentId, component] : m_Components) {
|
||||
component->LoadConfigData();
|
||||
}
|
||||
|
||||
for (const auto&[componentId, component] : m_Components) {
|
||||
component->Startup();
|
||||
}
|
||||
if (!IsPlayer()) return; // No save data to load for non players
|
||||
|
||||
for (const auto&[componentId, component] : m_Components) {
|
||||
component->LoadFromXml(m_Character->GetXMLDoc());
|
||||
}
|
||||
}
|
||||
|
||||
bool Entity::operator==(const Entity& other) const {
|
||||
|
Reference in New Issue
Block a user