mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-20 18:55:28 +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) :
|
CollectibleComponent::CollectibleComponent(Entity* parentEntity, const int32_t componentID, const int32_t collectibleId) :
|
||||||
Component(parentEntity, componentID), m_CollectibleId(collectibleId) {
|
Component(parentEntity, componentID), m_CollectibleId(collectibleId) {
|
||||||
RegisterMsg(&CollectibleComponent::MsgGetObjectReportInfo);
|
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;
|
if (row) m_RequirementMission = row->requirementMission;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ public:
|
|||||||
static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::COLLECTIBLE;
|
static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::COLLECTIBLE;
|
||||||
CollectibleComponent(Entity* parentEntity, const int32_t componentID, const int32_t collectibleId);
|
CollectibleComponent(Entity* parentEntity, const int32_t componentID, const int32_t collectibleId);
|
||||||
|
|
||||||
|
void LoadDataFromTemplate() override;
|
||||||
|
|
||||||
int16_t GetCollectibleId() const { return m_CollectibleId; }
|
int16_t GetCollectibleId() const { return m_CollectibleId; }
|
||||||
void Serialize(RakNet::BitStream& outBitStream, bool isConstruction) override;
|
void Serialize(RakNet::BitStream& outBitStream, bool isConstruction) override;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user