[Scummvm-git-logs] scummvm master -> 99d50975cc0b261b2e2c000dc7e11dfde02a4f53
dreammaster
dreammaster at scummvm.org
Sat Aug 12 18:23:03 CEST 2017
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:
99d50975cc TITANIC: Fix to processing textual numbers in sentences
Commit: 99d50975cc0b261b2e2c000dc7e11dfde02a4f53
https://github.com/scummvm/scummvm/commit/99d50975cc0b261b2e2c000dc7e11dfde02a4f53
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-08-12T12:22:57-04:00
Commit Message:
TITANIC: Fix to processing textual numbers in sentences
Changed paths:
engines/titanic/true_talk/tt_parser.cpp
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 4ed9705..1a5c2b9 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -402,7 +402,7 @@ int TTparser::replaceNumbers(TTstring &line, int startIndex) {
int total = 0, factor = 0;
do {
- if (numEntry->_flags & NF_1) {
+ if (!(numEntry->_flags & NF_1)) {
flag2 = true;
if (numEntry->_flags & NF_8)
flag1 = true;
@@ -437,8 +437,13 @@ int TTparser::replaceNumbers(TTstring &line, int startIndex) {
total = -total;
CString numStr = CString::format("%d", total);
- line = CString(line.c_str(), line.c_str() + startIndex) + numStr +
- CString(line.c_str() + index);
+ line = CString::format("%s%s%s",
+ CString(line.c_str(), line.c_str() + startIndex).c_str(),
+ numStr.c_str(),
+ (index == -1) ? "" : line.c_str() + index
+ );
+
+ index = startIndex + numStr.size();
return index;
}
More information about the Scummvm-git-logs
mailing list