[Scummvm-git-logs] scummvm branch-2-1 -> d80a363cdb45d943e85693a6f9f0e3d65e29bb95
athrxx
athrxx at scummvm.org
Thu Oct 31 13:14:41 CET 2019
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:
d80a363cdb KYRA: (LOL) - fix item pickup glitch
Commit: d80a363cdb45d943e85693a6f9f0e3d65e29bb95
https://github.com/scummvm/scummvm/commit/d80a363cdb45d943e85693a6f9f0e3d65e29bb95
Author: athrxx (athrxx at scummvm.org)
Date: 2019-10-31T13:13:57+01:00
Commit Message:
KYRA: (LOL) - fix item pickup glitch
This fixes an original bug that recently got my attention.
While I never managed to duplicate items like the person in the video I did experience lockups.
Maybe the exploit works only with the original executable...
https://www.youtube.com/watch?v=fkJ2KilULco&feature=youtu.be
https://www.youtube.com/watch?v=4oRESbQLDig&feature=youtu.be
Changed paths:
engines/kyra/gui/gui_lol.cpp
diff --git a/engines/kyra/gui/gui_lol.cpp b/engines/kyra/gui/gui_lol.cpp
index 293d507..602309c 100644
--- a/engines/kyra/gui/gui_lol.cpp
+++ b/engines/kyra/gui/gui_lol.cpp
@@ -1300,9 +1300,18 @@ int LoLEngine::clickedScenePickupItem(Button *button) {
redrawSceneItem();
+ // WORKAROUND for original bug that allowed picking up items by clicking exactly 1 pixel from the
+ // left, right or bottom border (which could even cause lockups). We simply clip the item pixel
+ // search zone to the dimensions of the calling button...
+ const ScreenDim *dim = _screen->getScreenDim(button->dimTableIndex);
+ int clipLeft = (dim->sx << 3) + button->x;
+ int clipTop = dim->sy + button->y;
+ int clipRight = (dim->sx << 3) + button->x + button->width - 1;
+ int clipBottom = dim->sy + button->y + button->height - 1;
+
int p = 0;
for (int i = 0; i < len; i++) {
- p = _screen->getPagePixel(_screen->_curPage, CLIP(_mouseX + checkX[i], 0, 320), CLIP(_mouseY + checkY[i], 0, 200));
+ p = _screen->getPagePixel(_screen->_curPage, CLIP(_mouseX + checkX[i], clipLeft, clipRight), CLIP(_mouseY + checkY[i], clipTop, clipBottom));
if (p)
break;
}
More information about the Scummvm-git-logs
mailing list