[Scummvm-git-logs] scummvm master -> 5c62d90c1b7bd9627b2e6f5175b6aa1b145258d5

dreammaster dreammaster at scummvm.org
Mon Apr 9 00:25:50 CEST 2018


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
5c62d90c1b XEEN: Fix display of negative values in Character dialog HP tooltip


Commit: 5c62d90c1b7bd9627b2e6f5175b6aa1b145258d5
    https://github.com/scummvm/scummvm/commit/5c62d90c1b7bd9627b2e6f5175b6aa1b145258d5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-04-08T18:25:41-04:00

Commit Message:
XEEN: Fix display of negative values in Character dialog HP tooltip

Changed paths:
    engines/xeen/dialogs/dialogs_char_info.cpp


diff --git a/engines/xeen/dialogs/dialogs_char_info.cpp b/engines/xeen/dialogs/dialogs_char_info.cpp
index 08b9aed..aec8be5 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





More information about the Scummvm-git-logs mailing list