diff --git a/src/creatures/players/player.cpp b/src/creatures/players/player.cpp index bdae3594..457db114 100644 --- a/src/creatures/players/player.cpp +++ b/src/creatures/players/player.cpp @@ -3518,11 +3518,11 @@ void Player::death(const std::shared_ptr &lastHitCreature) { } } - double magicLossPercent = deathLossPercent / 100.; + double magicLossPercent = deathLossPercent / 100.; if (g_configManager().getBoolean(HALF_LOSS_MAGIC) && magicLossPercent > 0) { magicLossPercent /= 2; } - + lostMana = static_cast(sumMana * magicLossPercent); while (lostMana > manaSpent && magLevel > 0) { @@ -3565,11 +3565,11 @@ void Player::death(const std::shared_ptr &lastHitCreature) { sumSkillTries += skills[i].tries; - double skillLossPercent = deathLossPercent / 100.; + double skillLossPercent = deathLossPercent / 100.; if (g_configManager().getBoolean(HALF_LOSS_SKILL) && skillLossPercent > 0) { skillLossPercent /= 2; } - + auto lostSkillTries = static_cast(sumSkillTries * skillLossPercent); while (lostSkillTries > skills[i].tries) { lostSkillTries -= skills[i].tries; @@ -3819,7 +3819,7 @@ std::shared_ptr Player::getCorpse(const std::shared_ptr &lastHit descriptionStream << fmt::format("You recognize {}. {} was killed by ", getNameDescription(), subjectPronoun); std::vector killers; - for (const auto& [creatureId, damageInfo] : damageMap) { + for (const auto &[creatureId, damageInfo] : damageMap) { auto damageDealer = g_game().getCreatureByID(creatureId); if (damageDealer) { killers.push_back(damageDealer->getNameDescription()); @@ -5131,7 +5131,7 @@ ItemsTierCountList Player::getDepotInboxItemsId() const { } } - return itemMap;; + return itemMap; } std::vector> Player::getAllInventoryItems(bool ignoreEquiped /*= false*/, bool ignoreItemWithTier /* false*/) const { @@ -5689,8 +5689,7 @@ void Player::onAttacked() { addInFightTicks(); } -bool Player::checkLoginDelay(uint32_t playerId) const -{ +bool Player::checkLoginDelay(uint32_t playerId) const { return (OTSYS_TIME() <= (lastLoad + g_configManager().getNumber(LOGIN_PROTECTION)) && !hasBeenAttacked(playerId)); } @@ -6365,7 +6364,7 @@ uint32_t Player::getAttackSpeed() const { bool onFistAttackSpeed = g_configManager().getBoolean(TOGGLE_ATTACK_SPEED_ONFIST); uint32_t MAX_ATTACK_SPEED = g_configManager().getNumber(MAX_SPEED_ATTACKONFIST); - const auto& mount = g_game().mounts->getMountByID(getCurrentMount()); + const auto &mount = g_game().mounts->getMountByID(getCurrentMount()); if (isMounted() && mount) { if (mount->attackSpeed > 0) { if (mount->attackSpeed >= vocation->getAttackSpeed()) { @@ -9892,7 +9891,7 @@ void Player::onCreatureAppear(const std::shared_ptr &creature, bool is sendBlessStatus(); } - if (g_configManager().getBoolean(ALWAYS_MOUNT_LOGIN) && getCurrentMount() != 0) { + if (g_configManager().getBoolean(ALWAYS_MOUNT_LOGIN) && getCurrentMount() != 0) { toggleMount(true); } diff --git a/src/game/game.cpp b/src/game/game.cpp index 173806ec..9b0cc448 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -3323,7 +3323,7 @@ ObjectCategory_t Game::getObjectCategory(const ItemType &it) { uint64_t Game::getItemMarketPrice(const std::map &itemMap, bool buyPrice) const { uint64_t total = 0; - for (const auto& [itemId, itemCount] : itemMap) { + for (const auto &[itemId, itemCount] : itemMap) { switch (itemId) { case ITEM_GOLD_COIN: total += itemCount; @@ -3340,11 +3340,11 @@ uint64_t Game::getItemMarketPrice(const std::map &itemMap, b default: { auto marketIt = itemsPriceMap.find(itemId); if (marketIt != itemsPriceMap.end()) { - for (const auto& [tier, price] : marketIt->second) { + for (const auto &[tier, price] : marketIt->second) { total += price * itemCount; } } else { - const ItemType& itemType = Item::items[itemId]; + const ItemType &itemType = Item::items[itemId]; uint64_t price = buyPrice ? itemType.buyPrice : itemType.sellPrice; total += price * itemCount; } @@ -10396,7 +10396,7 @@ void Game::updateForgeableMonsters() { void Game::createFiendishMonsters() { uint32_t created = 0; uint32_t fiendishLimit = g_configManager().getNumber(FORGE_FIENDISH_CREATURES_LIMIT); // Fiendish Creatures limit - + while (fiendishMonsters.size() < fiendishLimit) { if (fiendishMonsters.size() >= fiendishLimit) { g_logger().warn("[{}] - Returning in creation of Fiendish, size: {}, max is: {}.", __FUNCTION__, fiendishMonsters.size(), fiendishLimit); @@ -10414,7 +10414,7 @@ void Game::createFiendishMonsters() { void Game::createInfluencedMonsters() { uint32_t created = 0; uint32_t influencedLimit = g_configManager().getNumber(FORGE_INFLUENCED_CREATURES_LIMIT); - + while (influencedMonsters.size() < influencedLimit) { if (influencedMonsters.size() >= influencedLimit) { g_logger().warn("[{}] - Returning in creation of Influenced, size: {}, max is: {}.", __FUNCTION__, influencedMonsters.size(), influencedLimit);