MYST3: Don't let getTextData() add extra string terminators

Recently, the String class was modified to not allow appending
terminators to a string. This was done to fix a Myst III
regression, though apparently the Stark engine was also
impacted somehow?

The aim of this change is to not append terminators to the string,
to ensure that it will keep working regardless of how the String
class handles it.
This commit is contained in:
Torbjörn Andersson 2020-11-30 09:58:35 +01:00 committed by Eugene Sandulenko
parent 104cadd380
commit 7ba35924a4

View File

@ -286,17 +286,14 @@ Common::String ResourceDescription::getTextData(uint index) const {
// extract the wanted one
cnt = 0;
int i = 0;
Common::String text;
while (cnt <= index && i < 89) {
if (cnt == index)
text += decrypted[i];
while (cnt < index) {
if (!decrypted[i])
cnt++;
i++;
}
Common::String text((const char *)&decrypted[i]);
return text;
}