mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-23 11:04:44 +00:00
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:
parent
104cadd380
commit
7ba35924a4
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user