1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-21 09:09:43 +00:00

Clarify CharacterCreation::setValue

This commit is contained in:
Evil Eye 2023-05-21 19:53:31 +02:00
parent 4e05dd3cd3
commit ed7b6dc2a7

View file

@ -107,9 +107,10 @@ namespace MWGui
if (id.starts_with(prefix) && id.size() == prefix.size() + 1)
{
char index = id[prefix.size()];
auto attribute = static_cast<ESM::Attribute::AttributeID>(index - '0' - 1);
if (attribute >= ESM::Attribute::Strength && attribute < ESM::Attribute::Length)
if (index >= '1' && index <= '8')
{
// Match [AttribVal1-AttribVal8] to the corresponding AttributeID values [0-7]
auto attribute = static_cast<ESM::Attribute::AttributeID>(index - '0' - 1);
mPlayerAttributes[attribute] = value;
if (mReviewDialog)
mReviewDialog->setAttribute(attribute, value);