[Scummvm-git-logs] scummvm master -> aa296eac73a43f1ec0a05d75be67f92a55716894

AndywinXp noreply at scummvm.org
Tue Aug 27 20:44:18 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
aa296eac73 SCUMM: Fix behavior of bad control code in handleNextCharsetCode()


Commit: aa296eac73a43f1ec0a05d75be67f92a55716894
    https://github.com/scummvm/scummvm/commit/aa296eac73a43f1ec0a05d75be67f92a55716894
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-08-27T22:44:12+02:00

Commit Message:
SCUMM: Fix behavior of bad control code in handleNextCharsetCode()

Changed paths:
    engines/scumm/string.cpp


diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp
index 3b74f47ca10..bbd25feedee 100644
--- a/engines/scumm/string.cpp
+++ b/engines/scumm/string.cpp
@@ -529,8 +529,8 @@ bool ScummEngine_v72he::handleNextCharsetCode(Actor *a, int *code) {
 			endLoop = endText = true;
 			break;
 		default:
-			// Ignore the control code, reset the buffer position...
-			buffer--;
+			// Ignore the control code...
+			warning("ScummEngine_v72he::handleNextCharsetCode(): Ignoring invalid control code");
 		}
 	}
 	_charsetBufPos = buffer - _charsetBuffer;
@@ -1499,8 +1499,8 @@ int ScummEngine::convertMessageToString(const byte *msg, byte *dst, int dstSize)
 					}
 					break;
 				default:
-					// Invalid control code. Just print the character...
-					*dst++ = chr;
+					// Invalid control code. Just ignore it and set the buffer index where it should be...
+					num -= 2;
 				}
 				num += (_game.version == 8) ? 4 : 2;
 			}




More information about the Scummvm-git-logs mailing list