From 927f53368b52f6340d7e1ba467655a5d659b9522 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 28 Jan 2017 09:22:26 -0500 Subject: [PATCH] TITANIC: Properly handle uppercase and 's when normalizing conv text --- engines/titanic/true_talk/tt_parser.cpp | 4 ++-- engines/titanic/true_talk/tt_parser.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp index bd89079cf15f..c55735929575 100644 --- a/engines/titanic/true_talk/tt_parser.cpp +++ b/engines/titanic/true_talk/tt_parser.cpp @@ -131,7 +131,7 @@ int TTparser::normalize(TTsentence *sentence) { if (!destLine->empty() && destLine->lastChar() != ' ') (*destLine) += ' '; } else if (Common::isUpper(c)) { - (*destLine) += toupper(c); + (*destLine) += tolower(c); } else if (Common::isDigit(c)) { if (c == '0' && isEmoticon(srcLine, index)) { sentence->set38(10); @@ -256,7 +256,7 @@ int TTparser::isEmoticon(const TTstring &str, int &index) { } } -bool TTparser::normalizeContraction(const TTstring &srcLine, int srcIndex, TTstring &destLine) { +bool TTparser::normalizeContraction(const TTstring &srcLine, int &srcIndex, TTstring &destLine) { int startIndex = srcIndex + 1; switch (srcLine[startIndex]) { case 'd': diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h index 5fd997a9855f..458a719e1fba 100644 --- a/engines/titanic/true_talk/tt_parser.h +++ b/engines/titanic/true_talk/tt_parser.h @@ -95,7 +95,7 @@ class TTparser { * Submethod called by normalize to handle expanding contacted word pairs * like can't, should've, and so on. */ - bool normalizeContraction(const TTstring &srcLine, int srcIndex, TTstring &destLine); + bool normalizeContraction(const TTstring &srcLine, int &srcIndex, TTstring &destLine); /** * Checks for what is likely special developer cheat codes