XEEN: Fix for invalid numbers in Character Info dialog

This commit is contained in:
Paul Gilbert 2019-10-30 20:32:07 -07:00
parent 530798f629
commit 1381cc3fee

View File

@ -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),