Skip to content

Commit

Permalink
Code format - (Clang-format)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jan 24, 2025
1 parent 271b7fe commit 2174809
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/creatures/combat/combat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -846,9 +846,9 @@ void Combat::CombatDispelFunc(const std::shared_ptr<Creature> &, 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);
}
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/creatures/players/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5463,12 +5463,12 @@ std::vector<std::shared_ptr<Item>> Player::getEquippedItems() const {
}

std::shared_ptr<Item> 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<uint32_t, uint32_t> &Player::getAllItemTypeCount(std::map<uint32_t, uint32_t> &countMap) const {
Expand Down
10 changes: 5 additions & 5 deletions src/creatures/players/player.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1260,11 +1260,11 @@ class Player final : public Creature, public Cylinder, public Bankable {
std::vector<std::shared_ptr<Item>> 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<Item> getEquippedItem(Slots_t slot) const;

// Player wheel interface
Expand Down

0 comments on commit 2174809

Please sign in to comment.