mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-10 01:18:07 +00:00
Move to shared pointer
This commit is contained in:
@@ -92,7 +92,7 @@ Item::Item(
|
||||
|
||||
inventory->AddManagedItem(this);
|
||||
|
||||
auto* entity = inventory->GetComponent()->GetOwningEntity();
|
||||
auto entity = inventory->GetComponent()->GetOwningEntity();
|
||||
GameMessages::SendAddItemToInventoryClientSync(entity, entity->GetSystemAddress(), this, id, showFlyingLoot, static_cast<int>(this->count), subKey, lootSourceType);
|
||||
|
||||
if (isModMoveAndEquip) {
|
||||
@@ -166,7 +166,7 @@ void Item::SetCount(const uint32_t value, const bool silent, const bool disassem
|
||||
}
|
||||
|
||||
if (!silent) {
|
||||
auto* entity = inventory->GetComponent()->GetOwningEntity();
|
||||
auto entity = inventory->GetComponent()->GetOwningEntity();
|
||||
|
||||
if (value > count) {
|
||||
GameMessages::SendAddItemToInventoryClientSync(entity, entity->GetSystemAddress(), this, id, showFlyingLoot, delta, LWOOBJID_EMPTY, lootSourceType);
|
||||
@@ -231,7 +231,7 @@ void Item::UnEquip() {
|
||||
}
|
||||
|
||||
bool Item::IsEquipped() const {
|
||||
auto* component = inventory->GetComponent();
|
||||
auto component = inventory->GetComponent();
|
||||
|
||||
for (const auto& pair : component->GetEquippedItems()) {
|
||||
const auto item = pair.second;
|
||||
@@ -278,7 +278,7 @@ void Item::UseNonEquip(Item* item) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto* playerInventoryComponent = GetInventory()->GetComponent();
|
||||
auto playerInventoryComponent = GetInventory()->GetComponent();
|
||||
if (!playerInventoryComponent) {
|
||||
Game::logger->LogDebug("Item", "no inventory component attached to item id %llu lot %i", this->GetId(), this->GetLot());
|
||||
return;
|
||||
|
@@ -125,8 +125,8 @@ void ItemSet::OnEquip(const LOT lot) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto* skillComponent = m_InventoryComponent->GetOwningEntity()->GetComponent<SkillComponent>();
|
||||
auto* missionComponent = m_InventoryComponent->GetOwningEntity()->GetComponent<MissionComponent>();
|
||||
auto skillComponent = m_InventoryComponent->GetOwningEntity()->GetComponent<SkillComponent>();
|
||||
auto missionComponent = m_InventoryComponent->GetOwningEntity()->GetComponent<MissionComponent>();
|
||||
|
||||
for (const auto skill : skillSet) {
|
||||
auto* skillTable = CDClientManager::Instance().GetTable<CDSkillBehaviorTable>();
|
||||
|
@@ -37,8 +37,8 @@ void ItemSetPassiveAbility::Activate(Entity* target) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto* destroyableComponent = m_Parent->GetComponent<DestroyableComponent>();
|
||||
auto* skillComponent = m_Parent->GetComponent<SkillComponent>();
|
||||
auto destroyableComponent = m_Parent->GetComponent<DestroyableComponent>();
|
||||
auto skillComponent = m_Parent->GetComponent<SkillComponent>();
|
||||
|
||||
if (destroyableComponent == nullptr || skillComponent == nullptr) {
|
||||
return;
|
||||
@@ -196,8 +196,8 @@ std::vector<ItemSetPassiveAbility> ItemSetPassiveAbility::FindAbilities(uint32_t
|
||||
}
|
||||
|
||||
void ItemSetPassiveAbility::OnEnemySmshed(Entity* target) {
|
||||
auto* destroyableComponent = m_Parent->GetComponent<DestroyableComponent>();
|
||||
auto* skillComponent = m_Parent->GetComponent<SkillComponent>();
|
||||
auto destroyableComponent = m_Parent->GetComponent<DestroyableComponent>();
|
||||
auto skillComponent = m_Parent->GetComponent<SkillComponent>();
|
||||
|
||||
if (destroyableComponent == nullptr || skillComponent == nullptr) {
|
||||
return;
|
||||
|
Reference in New Issue
Block a user