diff --git a/Source/player.cpp b/Source/player.cpp index 78b6f248667..03451c66184 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -2057,13 +2057,13 @@ void Player::UpdatePreviewCelSprite(_cmd_id cmdId, Point point, uint16_t wParam1 int32_t Player::calculateBaseLife() const { - const PlayerData playerData = PlayersData[static_cast(_pClass)]; + const PlayerData &playerData = PlayersData[static_cast(_pClass)]; return playerData.adjLife + (playerData.lvlLife * _pLevel) + (playerData.chrLife * _pBaseVit); } int32_t Player::calculateBaseMana() const { - const PlayerData playerData = PlayersData[static_cast(_pClass)]; + const PlayerData &playerData = PlayersData[static_cast(_pClass)]; return playerData.adjMana + (playerData.lvlMana * _pLevel) + (playerData.chrMana * _pBaseMag); } @@ -2277,7 +2277,7 @@ void CreatePlayer(Player &player, HeroClass c) player = {}; SetRndSeed(SDL_GetTicks()); - PlayerData playerData = PlayersData[static_cast(c)]; + const PlayerData &playerData = PlayersData[static_cast(c)]; player._pLevel = 1; player._pClass = c;