diff --git a/Source/player.cpp b/Source/player.cpp index ed9cbc852..c636cda75 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -115,17 +115,7 @@ int ToBlkTbl[NUM_CLASSES] = { 25, 30, }; -/** Maps from player_class to maximum stats. */ -int MaxStats[NUM_CLASSES][4] = { - // clang-format off - { 250, 50, 60, 100 }, - { 55, 70, 250, 80 }, - { 45, 250, 85, 80 }, - { 150, 80, 150, 80 }, - { 120, 120, 120, 100 }, - { 255, 0, 55, 150 }, - // clang-format on -}; + /** Specifies the experience point limit of each level. */ int ExpLvlsTbl[MAXCHARLEVEL] = { 0, @@ -207,6 +197,17 @@ Sint32 PlayerStruct::GetBaseAttributeValue(attribute_id attribute) const Sint32 PlayerStruct::GetMaximumAttributeValue(attribute_id attribute) const { + static const int MaxStats[NUM_CLASSES][4] = { + // clang-format off + { 250, 50, 60, 100 }, + { 55, 70, 250, 80 }, + { 45, 250, 85, 80 }, + { 150, 80, 150, 80 }, + { 120, 120, 120, 100 }, + { 255, 0, 55, 150 }, + // clang-format on + }; + return MaxStats[_pClass][attribute]; } diff --git a/Source/player.h b/Source/player.h index 3121c9ae3..6ca5b2b8a 100644 --- a/Source/player.h +++ b/Source/player.h @@ -314,7 +314,6 @@ extern int StrengthTbl[NUM_CLASSES]; extern int MagicTbl[NUM_CLASSES]; extern int DexterityTbl[NUM_CLASSES]; extern int VitalityTbl[NUM_CLASSES]; -extern int MaxStats[NUM_CLASSES][4]; extern int ExpLvlsTbl[MAXCHARLEVEL]; #ifdef __cplusplus