diff options
author | Paul Gilbert | 2018-04-08 18:25:41 -0400 |
---|---|---|
committer | Paul Gilbert | 2018-04-08 18:25:41 -0400 |
commit | 5c62d90c1b7bd9627b2e6f5175b6aa1b145258d5 (patch) | |
tree | f2150fd5bf1badb04c739a56d8525b6e96a0f709 /engines/xeen/dialogs/dialogs_char_info.cpp | |
parent | fa9218f2d2b0113afdc839b1edeb7b56f6889c04 (diff) | |
download | scummvm-rg350-5c62d90c1b7bd9627b2e6f5175b6aa1b145258d5.tar.gz scummvm-rg350-5c62d90c1b7bd9627b2e6f5175b6aa1b145258d5.tar.bz2 scummvm-rg350-5c62d90c1b7bd9627b2e6f5175b6aa1b145258d5.zip |
XEEN: Fix display of negative values in Character dialog HP tooltip
Diffstat (limited to 'engines/xeen/dialogs/dialogs_char_info.cpp')
-rw-r--r-- | engines/xeen/dialogs/dialogs_char_info.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/engines/xeen/dialogs/dialogs_char_info.cpp b/engines/xeen/dialogs/dialogs_char_info.cpp index 08b9aed8b1..aec8be5ee4 100644 --- a/engines/xeen/dialogs/dialogs_char_info.cpp +++ b/engines/xeen/dialogs/dialogs_char_info.cpp @@ -396,14 +396,18 @@ bool CharacterInfo::expandStat(int attrib, const Character &c) { bounds.setHeight(42); break; - case 10: + case 10: { // Hit Points - stat1 = c._currentHp; - stat2 = c.getMaxHP(); - msg = Common::String::format(Res.CURRENT_MAXIMUM_TEXT, Res.STAT_NAMES[attrib], - stat1, stat2); + Common::String fmt(Res.CURRENT_MAXIMUM_TEXT); + const char *p; + while ((p = strstr(fmt.c_str(), "%u")) != nullptr) + fmt.setChar('d', p - fmt.c_str() + 1); + + msg = Common::String::format(fmt.c_str(), Res.STAT_NAMES[attrib], + c._currentHp, c.getMaxHP()); bounds.setHeight(42); break; + } case 11: // Spell Points |