feat: Add component ID to root component object

This commit is contained in:
David Markowitz
2025-10-02 01:32:50 -07:00
parent 670cb124c0
commit dbb6e3e0b8
106 changed files with 263 additions and 259 deletions

View File

@@ -43,9 +43,8 @@ std::unordered_map<LWOOBJID, LWOOBJID> PetComponent::activePets{};
* while the faction ones could be checked using their respective missions.
*/
PetComponent::PetComponent(Entity* parentEntity, uint32_t componentId) : Component{ parentEntity } {
m_PetInfo = CDClientManager::GetTable<CDPetComponentTable>()->GetByID(componentId); // TODO: Make reference when safe
m_ComponentId = componentId;
PetComponent::PetComponent(Entity* parentEntity, const int32_t componentID) : Component{ parentEntity, componentID } {
m_PetInfo = CDClientManager::GetTable<CDPetComponentTable>()->GetByID(componentID); // TODO: Make reference when safe
m_Interaction = LWOOBJID_EMPTY;
m_Owner = LWOOBJID_EMPTY;
@@ -537,7 +536,7 @@ void PetComponent::NotifyTamingBuildSuccess(NiPoint3 position) {
// Triggers the catch a pet missions
constexpr auto PET_FLAG_BASE = 800;
tamer->GetCharacter()->SetPlayerFlag(PET_FLAG_BASE + m_ComponentId, true);
tamer->GetCharacter()->SetPlayerFlag(PET_FLAG_BASE + m_ComponentID, true);
auto* missionComponent = tamer->GetComponent<MissionComponent>();