Skip to content

Commit

Permalink
STARTREK: Fix failed action texts
Browse files Browse the repository at this point in the history
  • Loading branch information
bluegr committed Aug 18, 2019
1 parent 6a9969e commit 8e69e9e
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions engines/startrek/startrek.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,18 +628,25 @@ Common::String StarTrekEngine::getLoadedText(int textIndex) {

Common::String str;
byte cur;
while (textIndex != 0) {
int curIndex = 0;

while (!txtFile->eos()) {
do {
cur = txtFile->readByte();
if (cur != '\0')
str += cur;
str += cur;
} while (cur != '\0');
textIndex--;
}

delete txtFile;
if (curIndex == textIndex) {
delete txtFile;
return str;
}

return str;
curIndex++;
str = "";
}

delete txtFile;
return "";
}

} // End of namespace StarTrek

0 comments on commit 8e69e9e

Please sign in to comment.