refactor(component): the mission offer loads its missions in LoadDataFromTemplate

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-10-01 08:08:11 -05:00
parent 060517920f
commit 90c7293189
2 changed files with 9 additions and 3 deletions

View File

@@ -43,12 +43,16 @@ bool OfferedMission::GetAcceptsMission() const {
MissionOfferComponent::MissionOfferComponent(Entity* parent, const int32_t componentID) : Component(parent, componentID) {
RegisterMsg(&MissionOfferComponent::OnRequestUse);
if (componentID != -1) {
}
// The MissionNPCComponent rows: the missions this offers and accepts
void MissionOfferComponent::LoadDataFromTemplate() {
if (m_ComponentID != -1) {
// Now lookup the missions in the MissionNPCComponent table
auto* missionNpcComponentTable = CDClientManager::GetTable<CDMissionNPCComponentTable>();
auto missions = missionNpcComponentTable->Query([componentID](const CDMissionNPCComponent& entry) {
return entry.id == static_cast<unsigned>(componentID);
auto missions = missionNpcComponentTable->Query([this](const CDMissionNPCComponent& entry) {
return entry.id == static_cast<unsigned>(m_ComponentID);
});
for (auto& mission : missions) {

View File

@@ -65,6 +65,8 @@ public:
MissionOfferComponent(Entity* parent, const int32_t componentID);
void LoadDataFromTemplate() override;
/**
* Handles a RequestUse triggered by some entity, determines which missions to show based on what they may
* hand in now and what they may start based on their mission history.