[Scummvm-git-logs] scummvm master -> f3729de2741fd42106a7de64cd077b88692a4d73
athrxx
athrxx at scummvm.org
Thu Sep 23 21:07:42 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:
f3729de274 SCUMM: (SCUMM7/8) - fix minor walking code glitch
Commit: f3729de2741fd42106a7de64cd077b88692a4d73
https://github.com/scummvm/scummvm/commit/f3729de2741fd42106a7de64cd077b88692a4d73
Author: athrxx (athrxx at scummvm.org)
Date: 2021-09-23T23:07:06+02:00
Commit Message:
SCUMM: (SCUMM7/8) - fix minor walking code glitch
(see https://bugs.scummvm.org/ticket/12499#comment:11)
In Actor::startWalkActor() we call adjustXYToBeInBox() twice, first with the dest coords, then again with the resulting coords from the first call. In the example from the bug ticket (clicking on Kenny the lemonade selling pirate) this will adjust the x position from 503 to 501 on the first pass and from 501 to 500 on the second pass.
The original SCUMM 5 and 6 (I checked MI2 and SAM) actually do it exactly like that, so it becomes kind of obvious where our code originates from.
However, for SCUMM 7 and 8 (I checked FT, DIG, COMI) the function has been simplified considerately. It makes the call to adjustXYToBeInBox() only once (and no call to checkXYInBoxBounds() either), so in our COMI example the x position will stay at 501.
Changed paths:
engines/scumm/actor.cpp
diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index ad40ff4336..2478250641 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -805,10 +805,12 @@ void Actor::startWalkActor(int destX, int destY, int dir) {
abr.box = kInvalidBox;
_walkbox = kInvalidBox;
} else {
- if (_vm->checkXYInBoxBounds(_walkdata.destbox, abr.x, abr.y)) {
- abr.box = _walkdata.destbox;
- } else {
- abr = adjustXYToBeInBox(abr.x, abr.y);
+ if (_vm->_game.version < 7) {
+ if (_vm->checkXYInBoxBounds(_walkdata.destbox, abr.x, abr.y)) {
+ abr.box = _walkdata.destbox;
+ } else {
+ abr = adjustXYToBeInBox(abr.x, abr.y);
+ }
}
if (_moving && _walkdata.destdir == dir && _walkdata.dest.x == abr.x && _walkdata.dest.y == abr.y)
return;
More information about the Scummvm-git-logs
mailing list