mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-15 08:17:13 +00:00
refactor(component): the collectible loads its row in LoadDataFromTemplate
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -11,7 +11,11 @@
|
||||
CollectibleComponent::CollectibleComponent(Entity* parentEntity, const int32_t componentID, const int32_t collectibleId) :
|
||||
Component(parentEntity, componentID), m_CollectibleId(collectibleId) {
|
||||
RegisterMsg(&CollectibleComponent::MsgGetObjectReportInfo);
|
||||
const auto* const row = CDClientManager::GetTable<CDCollectibleComponentTable>()->GetByID(componentID);
|
||||
}
|
||||
|
||||
// The CollectibleComponent row
|
||||
void CollectibleComponent::LoadDataFromTemplate() {
|
||||
const auto* const row = CDClientManager::GetTable<CDCollectibleComponentTable>()->GetByID(m_ComponentID);
|
||||
if (row) m_RequirementMission = row->requirementMission;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ public:
|
||||
static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::COLLECTIBLE;
|
||||
CollectibleComponent(Entity* parentEntity, const int32_t componentID, const int32_t collectibleId);
|
||||
|
||||
void LoadDataFromTemplate() override;
|
||||
|
||||
int16_t GetCollectibleId() const { return m_CollectibleId; }
|
||||
void Serialize(RakNet::BitStream& outBitStream, bool isConstruction) override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user