aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen/dialogs
diff options
context:
space:
mode:
Diffstat (limited to 'engines/xeen/dialogs')
-rw-r--r--engines/xeen/dialogs/dialogs_char_info.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/xeen/dialogs/dialogs_char_info.cpp b/engines/xeen/dialogs/dialogs_char_info.cpp
index aec8be5ee4..3923caf172 100644
--- a/engines/xeen/dialogs/dialogs_char_info.cpp
+++ b/engines/xeen/dialogs/dialogs_char_info.cpp
@@ -359,9 +359,9 @@ bool CharacterInfo::expandStat(int attrib, const Character &c) {
// Basic attributes
stat1 = c.getStat((Attribute)attrib, false);
stat2 = c.getStat((Attribute)attrib, true);
- idx = 0;
- while (Res.STAT_VALUES[idx] <= (int)stat1)
- ++idx;
+ for (idx = 0; idx < ARRAYSIZE(Res.STAT_VALUES) - 1; ++idx)
+ if (Res.STAT_VALUES[idx] > (int)stat1)
+ break;
msg = Common::String::format(Res.CURRENT_MAXIMUM_RATING_TEXT, Res.STAT_NAMES[attrib],
stat1, stat2, Res.RATING_TEXT[idx]);