mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-15 00:07:13 +00:00
refactor(component): activities load their activity in the client's phases
The component ID's activity in LoadDataFromTemplate, the level's activityID in LoadConfigData; racing control picks its world's activity after both, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -38,16 +38,22 @@ namespace {
|
||||
|
||||
ActivityComponent::ActivityComponent(Entity* parent, int32_t componentID) : Component(parent, componentID) {
|
||||
RegisterMsg(&ActivityComponent::OnGetObjectReportInfo);
|
||||
/*
|
||||
* This is precisely what the client does functionally
|
||||
* Use the component id as the default activity id and load its data from the database
|
||||
* if activityID is specified and if that column exists in the activities table, update the activity info with that data.
|
||||
*/
|
||||
}
|
||||
|
||||
m_ActivityID = componentID;
|
||||
LoadActivityData(componentID);
|
||||
/*
|
||||
* This is precisely what the client does functionally
|
||||
* Use the component id as the default activity id and load its data from the database
|
||||
* if activityID is specified and if that column exists in the activities table, update the activity info with that data.
|
||||
*/
|
||||
void ActivityComponent::LoadDataFromTemplate() {
|
||||
m_ActivityID = m_ComponentID;
|
||||
LoadActivityData(m_ComponentID);
|
||||
}
|
||||
|
||||
// The level config's activityID, when there, replaces it
|
||||
void ActivityComponent::LoadConfigData() {
|
||||
if (m_Parent->HasVar(u"activityID")) {
|
||||
m_ActivityID = parent->GetVar<int32_t>(u"activityID");
|
||||
m_ActivityID = m_Parent->GetVar<int32_t>(u"activityID");
|
||||
LoadActivityData(m_ActivityID);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user