diff options
author | Paul Gilbert | 2017-08-12 12:22:57 -0400 |
---|---|---|
committer | Paul Gilbert | 2017-08-12 12:22:57 -0400 |
commit | 99d50975cc0b261b2e2c000dc7e11dfde02a4f53 (patch) | |
tree | 997eee2f971876f4aed7935a2f0316c6f2f26999 /engines | |
parent | eaab1f0472ea98294f7716d233d795fe4845cb8f (diff) | |
download | scummvm-rg350-99d50975cc0b261b2e2c000dc7e11dfde02a4f53.tar.gz scummvm-rg350-99d50975cc0b261b2e2c000dc7e11dfde02a4f53.tar.bz2 scummvm-rg350-99d50975cc0b261b2e2c000dc7e11dfde02a4f53.zip |
TITANIC: Fix to processing textual numbers in sentences
Diffstat (limited to 'engines')
-rw-r--r-- | engines/titanic/true_talk/tt_parser.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp index 4ed970533a..1a5c2b97a6 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; } |