[Scummvm-git-logs] scummvm master -> 0715affdd689fbe7e191cf76d183edad02687407
sluicebox
22204938+sluicebox at users.noreply.github.com
Tue May 25 16:34:32 UTC 2021
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:
0715affdd6 SCI: Use for loop in gameHasFanMadePatch()
Commit: 0715affdd689fbe7e191cf76d183edad02687407
https://github.com/scummvm/scummvm/commit/0715affdd689fbe7e191cf76d183edad02687407
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2021-05-25T10:31:59-06:00
Commit Message:
SCI: Use for loop in gameHasFanMadePatch()
Changed paths:
engines/sci/sci.cpp
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 150cc676d7..2539a446c0 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -476,28 +476,19 @@ bool SciEngine::gameHasFanMadePatch() {
// TODO: The bugs in SQ6 can't be tested till SCI2.1 support is finished
//{ GID_SQ6, 380, 16308, 15042, 0x0C }, // English
//{ GID_SQ6, 380, 11652, 0, 0x00 }, // German - patched file is the same size as the original
- // ** End marker ***************************
- { GID_FANMADE, 0, 0, 0, 0x00 }
};
- int curEntry = 0;
+ for (int i = 0; i < ARRAYSIZE(patchInfo); ++i) {
+ if (patchInfo[i].gameID == getGameId()) {
+ Resource *targetScript = _resMan->findResource(ResourceId(kResourceTypeScript, patchInfo[i].targetScript), 0);
- while (true) {
- if (patchInfo[curEntry].targetSize == 0)
- break;
-
- if (patchInfo[curEntry].gameID == getGameId()) {
- Resource *targetScript = _resMan->findResource(ResourceId(kResourceTypeScript, patchInfo[curEntry].targetScript), 0);
-
- if (targetScript && targetScript->size() + 2 == patchInfo[curEntry].targetSize) {
- if (patchInfo[curEntry].patchedByteOffset == 0)
+ if (targetScript && targetScript->size() + 2 == patchInfo[i].targetSize) {
+ if (patchInfo[i].patchedByteOffset == 0)
return true;
- else if (targetScript->getUint8At(patchInfo[curEntry].patchedByteOffset - 2) == patchInfo[curEntry].patchedByte)
+ else if (targetScript->getUint8At(patchInfo[i].patchedByteOffset - 2) == patchInfo[i].patchedByte)
return true;
}
}
-
- curEntry++;
}
return false;
More information about the Scummvm-git-logs
mailing list