diff --git a/src/creatures/players/cyclopedia/player_badge.cpp b/src/creatures/players/cyclopedia/player_badge.cpp index 9ec627c359e..b9b1b0feedb 100644 --- a/src/creatures/players/cyclopedia/player_badge.cpp +++ b/src/creatures/players/cyclopedia/player_badge.cpp @@ -45,7 +45,7 @@ bool PlayerBadge::add(uint8_t id, uint32_t timestamp /* = 0*/) { int toSaveTimeStamp = timestamp != 0 ? timestamp : (OTSYS_TIME() / 1000); getUnlockedKV()->set(badge.m_name, toSaveTimeStamp); - m_badgesUnlocked.push_back({ badge, toSaveTimeStamp }); + m_badgesUnlocked.emplace_back(badge, toSaveTimeStamp); m_badgesUnlocked.shrink_to_fit(); return true; } @@ -94,7 +94,7 @@ void PlayerBadge::loadUnlockedBadges() { g_logger().debug("[{}] - Badge {} found for player {}.", __FUNCTION__, badge.m_name, m_player.getName()); - m_badgesUnlocked.push_back({ badge, getUnlockedKV()->get(badgeName)->getNumber() }); + m_badgesUnlocked.emplace_back(badge, getUnlockedKV()->get(badgeName)->getNumber()); } } diff --git a/src/creatures/players/cyclopedia/player_badge.hpp b/src/creatures/players/cyclopedia/player_badge.hpp index 0f157e32825..01c9dc0e63f 100644 --- a/src/creatures/players/cyclopedia/player_badge.hpp +++ b/src/creatures/players/cyclopedia/player_badge.hpp @@ -9,6 +9,8 @@ #pragma once +#include "game/game_definitions.hpp" + class Player; class KV; diff --git a/src/creatures/players/player.cpp b/src/creatures/players/player.cpp index d1c5570070a..359e7a81f97 100644 --- a/src/creatures/players/player.cpp +++ b/src/creatures/players/player.cpp @@ -630,7 +630,7 @@ phmap::flat_hash_map> Player::getAllSlotItems() c } phmap::flat_hash_map Player::getBlessingNames() const { - return { + static phmap::flat_hash_map blessingNames = { { TWIST_OF_FATE, "Twist of Fate" }, { WISDOM_OF_SOLITUDE, "The Wisdom of Solitude" }, { SPARK_OF_THE_PHOENIX, "The Spark of the Phoenix" }, @@ -640,6 +640,7 @@ phmap::flat_hash_map Player::getBlessingNames() const { BLOOD_OF_THE_MOUNTAIN, "Blood of the Mountain" }, { HEARTH_OF_THE_MOUNTAIN, "Heart of the Mountain" }, }; + return blessingNames; } void Player::setTraining(bool value) {