aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2019-10-30 20:32:07 -0700
committerPaul Gilbert2019-10-30 20:32:13 -0700
commit1381cc3feebcd40de422715b06b93cbdc12e1ead (patch)
tree4787e47876abaadcc96947e4dc1fb8a2e278922f /engines
parent530798f62999201a3273eb78cb8012e3d9a260fa (diff)
downloadscummvm-rg350-1381cc3feebcd40de422715b06b93cbdc12e1ead.tar.gz
scummvm-rg350-1381cc3feebcd40de422715b06b93cbdc12e1ead.tar.bz2
scummvm-rg350-1381cc3feebcd40de422715b06b93cbdc12e1ead.zip
XEEN: Fix for invalid numbers in Character Info dialog
Diffstat (limited to 'engines')
-rw-r--r--engines/xeen/dialogs/dialogs_char_info.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/engines/xeen/dialogs/dialogs_char_info.cpp b/engines/xeen/dialogs/dialogs_char_info.cpp
index 3923caf172..68374da080 100644
--- a/engines/xeen/dialogs/dialogs_char_info.cpp
+++ b/engines/xeen/dialogs/dialogs_char_info.cpp
@@ -289,7 +289,13 @@ Common::String CharacterInfo::loadCharacterDetails(const Character &c) {
c._energyResistence._permanent + c.itemScan(15) + c._energyResistence._temporary +
c._magicResistence._permanent + c.itemScan(16) + c._magicResistence._temporary;
- return Common::String::format(Res.CHARACTER_DETAILS,
+ // WORKAROUND: xeen.ccs format string has %lu for gold, gems, and experience
+ Common::String charDetails = Res.CHARACTER_DETAILS;
+ const char *p;
+ while ((p = strstr(charDetails.c_str(), "%lu")) != nullptr)
+ charDetails.deleteChar(p - charDetails.c_str() + 1);
+
+ return Common::String::format(charDetails.c_str(),
Res.PARTY_GOLD, c._name.c_str(), Res.SEX_NAMES[c._sex],
Res.RACE_NAMES[c._race], Res.CLASS_NAMES[c._class],
c.statColor(c.getStat(MIGHT), c.getStat(MIGHT, true)), c.getStat(MIGHT),