diff --git a/src/io/functions/iologindata_load_player.cpp b/src/io/functions/iologindata_load_player.cpp index 74c062e4918..7ba9c6dc413 100644 --- a/src/io/functions/iologindata_load_player.cpp +++ b/src/io/functions/iologindata_load_player.cpp @@ -482,7 +482,7 @@ void IOLoginDataLoad::loadPlayerInstantSpellList(const std::shared_ptr & } } -void IOLoginDataLoad::loadPlayerInventoryItems(const std::shared_ptr& player, DBResult_ptr result) { +void IOLoginDataLoad::loadPlayerInventoryItems(const std::shared_ptr &player, DBResult_ptr result) { if (!player) { g_logger().warn("[{}] - Player nullptr", __FUNCTION__); return; @@ -502,8 +502,8 @@ void IOLoginDataLoad::loadPlayerInventoryItems(const std::shared_ptr& pl loadItems(inventoryItems, result, player); - for (const auto& [slot, secondMap] : std::views::reverse(inventoryItems)) { - const auto& [item, pid] = secondMap; + for (const auto &[slot, secondMap] : std::views::reverse(inventoryItems)) { + const auto &[item, pid] = secondMap; if (!item) { continue; } @@ -518,14 +518,14 @@ void IOLoginDataLoad::loadPlayerInventoryItems(const std::shared_ptr& pl continue; } - const auto& container = it->second.first->getContainer(); + const auto &container = it->second.first->getContainer(); if (container) { container->internalAddThing(item); itemsToStartDecaying.emplace_back(item); } } - const auto& itemContainer = item->getContainer(); + const auto &itemContainer = item->getContainer(); if (!itemContainer) { continue; } @@ -554,17 +554,17 @@ void IOLoginDataLoad::loadPlayerInventoryItems(const std::shared_ptr& pl } // Starting decay for items - for (const auto& item : itemsToStartDecaying) { + for (const auto &item : itemsToStartDecaying) { item->startDecaying(); } // Sorting open containers and adding them to player if (!oldProtocol) { - std::ranges::sort(openContainersList, [](const auto& left, const auto& right) { + std::ranges::sort(openContainersList, [](const auto &left, const auto &right) { return left.first < right.first; }); - for (auto& [cid, container] : openContainersList) { + for (auto &[cid, container] : openContainersList) { player->addContainer(cid - 1, container); player->onSendContainer(container); } @@ -582,7 +582,7 @@ void IOLoginDataLoad::loadPlayerStoreInbox(const std::shared_ptr &player } } -void IOLoginDataLoad::loadRewardItems(const std::shared_ptr& player) { +void IOLoginDataLoad::loadRewardItems(const std::shared_ptr &player) { if (!player) { g_logger().warn("[{}] - Player nullptr", __FUNCTION__); return; @@ -598,7 +598,7 @@ void IOLoginDataLoad::loadRewardItems(const std::shared_ptr& player) { } } -void IOLoginDataLoad::loadPlayerDepotItems(const std::shared_ptr& player, DBResult_ptr result) { +void IOLoginDataLoad::loadPlayerDepotItems(const std::shared_ptr &player, DBResult_ptr result) { if (!player) { g_logger().warn("[{}] - Player nullptr", __FUNCTION__); return; @@ -615,8 +615,8 @@ void IOLoginDataLoad::loadPlayerDepotItems(const std::shared_ptr& player } loadItems(depotItems, result, player); - for (const auto& [slot, secondMap] : std::views::reverse(depotItems)) { - const auto& [item, pid] = secondMap; + for (const auto &[slot, secondMap] : std::views::reverse(depotItems)) { + const auto &[item, pid] = secondMap; if (!item) { continue; @@ -624,13 +624,13 @@ void IOLoginDataLoad::loadPlayerDepotItems(const std::shared_ptr& player // Adding items to player's depot chest or containers if (pid >= 0 && pid < 100) { - if (const auto& depotChest = player->getDepotChest(pid, true)) { + if (const auto &depotChest = player->getDepotChest(pid, true)) { depotChest->internalAddThing(item); item->startDecaying(); } } else { if (const auto depotIt = depotItems.find(pid); depotIt != depotItems.end()) { - if (const auto& container = depotIt->second.first->getContainer()) { + if (const auto &container = depotIt->second.first->getContainer()) { container->internalAddThing(item); itemsToStartDecaying.emplace_back(item); } @@ -639,12 +639,12 @@ void IOLoginDataLoad::loadPlayerDepotItems(const std::shared_ptr& player } // Start decay for items that were postponed - for (const auto& item : itemsToStartDecaying) { + for (const auto &item : itemsToStartDecaying) { item->startDecaying(); } } -void IOLoginDataLoad::loadPlayerInboxItems(const std::shared_ptr& player, DBResult_ptr result) { +void IOLoginDataLoad::loadPlayerInboxItems(const std::shared_ptr &player, DBResult_ptr result) { if (!player) { g_logger().warn("[{}] - Player nullptr", __FUNCTION__); return; @@ -661,8 +661,8 @@ void IOLoginDataLoad::loadPlayerInboxItems(const std::shared_ptr& player ItemsMap inboxItems; loadItems(inboxItems, result, player); - for (const auto& [slot, secondMap] : std::views::reverse(inboxItems)) { - const auto& [item, pid] = secondMap; + for (const auto &[slot, secondMap] : std::views::reverse(inboxItems)) { + const auto &[item, pid] = secondMap; if (!item) { continue; } @@ -679,7 +679,7 @@ void IOLoginDataLoad::loadPlayerInboxItems(const std::shared_ptr& player continue; } - const auto& container = item->getContainer(); + const auto &container = item->getContainer(); if (!container) { continue; } @@ -689,7 +689,7 @@ void IOLoginDataLoad::loadPlayerInboxItems(const std::shared_ptr& player } // Start decay for items that were postponed - for (const auto& item : itemsToStartDecaying) { + for (const auto &item : itemsToStartDecaying) { item->startDecaying(); } } @@ -888,7 +888,7 @@ void IOLoginDataLoad::bindRewardBag(const std::shared_ptr &player, Items void IOLoginDataLoad::insertItemsIntoRewardBag(const ItemsMap &rewardItemsMap) { for (const auto &[slotId, secondMap] : std::views::reverse(rewardItemsMap)) { - const auto& [item, pid] = secondMap; + const auto &[item, pid] = secondMap; if (!item) { continue; }