diff --git a/src/creatures/combat/combat.cpp b/src/creatures/combat/combat.cpp index 94ca2dfc..af37fc74 100644 --- a/src/creatures/combat/combat.cpp +++ b/src/creatures/combat/combat.cpp @@ -846,9 +846,9 @@ void Combat::CombatDispelFunc(const std::shared_ptr &, const std::shar if (params.dispelType == CONDITION_INVISIBLE) { if (const auto &player = target->getPlayer()) { const auto &item = player->getEquippedItem(CONST_SLOT_RING); - if (item && item->getID() == ITEM_STEALTH_RING_ACTIVATED && (g_game().getWorldType() == WORLD_TYPE_PVP_ENFORCED - || player->getTile()->hasFlag(TILESTATE_PVPZONE)) && normal_random(1, 100) <= 10) + if (item && item->getID() == ITEM_STEALTH_RING_ACTIVATED && (g_game().getWorldType() == WORLD_TYPE_PVP_ENFORCED || player->getTile()->hasFlag(TILESTATE_PVPZONE)) && normal_random(1, 100) <= 10) { g_game().internalRemoveItem(item); + } } } diff --git a/src/creatures/players/player.cpp b/src/creatures/players/player.cpp index c3c60c11..dbc74d30 100644 --- a/src/creatures/players/player.cpp +++ b/src/creatures/players/player.cpp @@ -5463,12 +5463,12 @@ std::vector> Player::getEquippedItems() const { } std::shared_ptr Player::getEquippedItem(Slots_t slot) const { - if (slot < CONST_SLOT_FIRST || slot >= CONST_SLOT_LAST) { - return nullptr; - } + if (slot < CONST_SLOT_FIRST || slot >= CONST_SLOT_LAST) { + return nullptr; + } - const auto &item = inventory[slot]; - return item; + const auto &item = inventory[slot]; + return item; } std::map &Player::getAllItemTypeCount(std::map &countMap) const { diff --git a/src/creatures/players/player.hpp b/src/creatures/players/player.hpp index 24c147c2..e5f13db1 100644 --- a/src/creatures/players/player.hpp +++ b/src/creatures/players/player.hpp @@ -1260,11 +1260,11 @@ class Player final : public Creature, public Cylinder, public Bankable { std::vector> getEquippedItems() const; /** - * @brief Get the equipped item in the specified slot. - * @details This function returns the item currently equipped in the given slot, or nullptr if the slot is empty or invalid. - * @param slot The slot from which to retrieve the equipped item. - * @return A pointer to the equipped item, or nullptr if no item is equipped in the specified slot. - */ + * @brief Get the equipped item in the specified slot. + * @details This function returns the item currently equipped in the given slot, or nullptr if the slot is empty or invalid. + * @param slot The slot from which to retrieve the equipped item. + * @return A pointer to the equipped item, or nullptr if no item is equipped in the specified slot. + */ std::shared_ptr getEquippedItem(Slots_t slot) const; // Player wheel interface