SCUMM: GUI: Insert workaround for german LOOM FM-Towns

Fixes a part of bug #13980
This commit is contained in:
AndywinXp 2022-12-27 15:00:56 +01:00
parent e28e804a47
commit 6f4acceede

View File

@ -1483,6 +1483,16 @@ void ScummEngine::queryQuit(bool returnToLauncher) {
convertMessageToString((const byte *)getGUIString(gsQuitPrompt), (byte *)msgLabelPtr, sizeof(msgLabelPtr));
if (msgLabelPtr[0] != '\0') {
// WORKAROUND: In the german version of LOOM FM-Towns, the string in the game data is stored with a '\r'
// character at the end. This means that the string being displayed on screen will end with "(J oder N)J",
// and localizedYesKey will be assigned to '\r'. Let's fix this by truncating the relevant string.
if (_enableEnhancements && _game.id == GID_LOOM &&
_game.platform == Common::kPlatformFMTowns &&
strstr(msgLabelPtr, "(J oder N)J\r")) {
msgLabelPtr[Common::strnlen(msgLabelPtr, sizeof(msgLabelPtr)) - 1] = '\0';
}
localizedYesKey = msgLabelPtr[Common::strnlen(msgLabelPtr, sizeof(msgLabelPtr)) - 1];
msgLabelPtr[Common::strnlen(msgLabelPtr, sizeof(msgLabelPtr)) - 1] = '\0';