diff --git a/src/creatures/players/cyclopedia/player_cyclopedia.cpp b/src/creatures/players/cyclopedia/player_cyclopedia.cpp index 5bb6c58504d..abbc920d322 100644 --- a/src/creatures/players/cyclopedia/player_cyclopedia.cpp +++ b/src/creatures/players/cyclopedia/player_cyclopedia.cpp @@ -18,6 +18,12 @@ PlayerCyclopedia::PlayerCyclopedia(Player &player) : m_player(player) { } +Summary PlayerCyclopedia::getSummary() { + return { getAmount(Summary_t::PREY_CARDS), + getAmount(Summary_t::INSTANT_REWARDS), + getAmount(Summary_t::HIRELINGS) }; +} + void PlayerCyclopedia::loadSummaryData() { DBResult_ptr result = g_database().storeQuery(fmt::format("SELECT COUNT(*) as `count` FROM `player_hirelings` WHERE `player_id` = {}", m_player.getGUID())); auto kvScoped = m_player.kv()->scoped("summary")->scoped(g_game().getSummaryKeyByType(static_cast(Summary_t::HIRELINGS))); diff --git a/src/creatures/players/cyclopedia/player_cyclopedia.hpp b/src/creatures/players/cyclopedia/player_cyclopedia.hpp index 6e3f654fa5b..32c446cc368 100644 --- a/src/creatures/players/cyclopedia/player_cyclopedia.hpp +++ b/src/creatures/players/cyclopedia/player_cyclopedia.hpp @@ -20,7 +20,7 @@ struct Summary { uint16_t m_instantRewards = 0; uint16_t m_hirelings = 0; - Summary(uint16_t mPreyWildcards, uint16_t mInstantRewards, uint16_t mHirelings) : + [[maybe_unused]] Summary(uint16_t mPreyWildcards, uint16_t mInstantRewards, uint16_t mHirelings) : m_preyWildcards(mPreyWildcards), m_instantRewards(mInstantRewards), m_hirelings(mHirelings) { } }; @@ -28,11 +28,7 @@ class PlayerCyclopedia { public: explicit PlayerCyclopedia(Player &player); - Summary getSummary() { - return { getAmount(Summary_t::PREY_CARDS), - getAmount(Summary_t::INSTANT_REWARDS), - getAmount(Summary_t::HIRELINGS) }; - } + Summary getSummary(); void loadSummaryData(); void loadDeathHistory(uint16_t page, uint16_t entriesPerPage); diff --git a/src/game/game.cpp b/src/game/game.cpp index 71964bfc0d4..7ef6b7a9038 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -10667,6 +10667,10 @@ Title Game::getTitleByName(const std::string &name) { return {}; } +const std::string &Game::getSummaryKeyByType(uint8_t type) { + return m_summaryCategories[type]; +} + const std::map &Game::getBlessingNames() { return m_blessingNames; } diff --git a/src/game/game.hpp b/src/game/game.hpp index 299235192c4..0537ee030a7 100644 --- a/src/game/game.hpp +++ b/src/game/game.hpp @@ -732,9 +732,7 @@ class Game { Title getTitleById(uint8_t id); Title getTitleByName(const std::string &name); - const std::string &getSummaryKeyByType(uint8_t type) { - return m_summaryCategories[type]; - } + const std::string &getSummaryKeyByType(uint8_t type); const std::map &getBlessingNames(); const std::unordered_map &getHirelingSkills();