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:
@@ -58,11 +58,18 @@ RacingControlComponent::RacingControlComponent(Entity* parent, const int32_t com
|
||||
const auto worldID = Game::server->GetZoneID();
|
||||
if (Game::zoneManager->CheckIfAccessibleZone((worldID / 10) * 10)) m_MainWorld = (worldID / 10) * 10;
|
||||
|
||||
RegisterMsg(&RacingControlComponent::MsgConfigureRacingControl);
|
||||
}
|
||||
|
||||
// After the activity's own loading: the race's activity is the one of this world (42 when none)
|
||||
void RacingControlComponent::LoadConfigData() {
|
||||
ActivityComponent::LoadConfigData();
|
||||
|
||||
const auto worldID = Game::server->GetZoneID();
|
||||
m_ActivityID = 42;
|
||||
CDActivitiesTable* activitiesTable = CDClientManager::GetTable<CDActivitiesTable>();
|
||||
std::vector<CDActivities> activities = activitiesTable->Query([=](CDActivities entry) {return (entry.instanceMapID == worldID); });
|
||||
for (CDActivities activity : activities) m_ActivityID = activity.ActivityID;
|
||||
RegisterMsg(&RacingControlComponent::MsgConfigureRacingControl);
|
||||
}
|
||||
|
||||
RacingControlComponent::~RacingControlComponent() {}
|
||||
|
||||
Reference in New Issue
Block a user