mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-25 12:05:53 +00:00
SCUMM: fix bug 12666 ("Dodgy path finding in Indy 3")
The particular scene with Indy and Donovan's men had all sorts of pathfinding issues compared to DOSBox: - Indy's initial facing was downwards instead of to the right when walking from the window to the "meeting point" and the path he walked wasn't exactly correct. - One of Donovan's men was facing down instead of left. - Indy would take several weird up and down walks at the walk box transition from box 1 to box 3 - Indy would walk over the grass instead of on the road. All fixes are from disasm. Some code I have removed (or rather commented out) seems to have been meant as a fix for bug no. 1778. So maybe that one has to be fixed again (correctly), but I don't know that yet. The scene is not 100% fixed yet. Donovan's men walk a bit too much upwards in the beginning. But I can do that separately... It will really be necessary to do some testing (and possibly more fixing) in the catacombs, in castle brunwald and in the zeppelin maze.
This commit is contained in:
parent
7c0baadc05
commit
8cbcde0c57
@ -547,14 +547,20 @@ int Actor::actorWalkStep() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (_walkbox != _walkdata.curbox && _vm->checkXYInBoxBounds(_walkdata.curbox, _pos.x, _pos.y)) {
|
||||
setBox(_walkdata.curbox);
|
||||
if (_vm->_game.version == 3) {
|
||||
if (_walkdata.next.x - (int)_speedx <= _pos.x && _walkdata.next.x + (int)_speedx >= _pos.x)
|
||||
_pos.x = _walkdata.next.x;
|
||||
if (_walkdata.next.y - (int)_speedy <= _pos.y && _walkdata.next.y + (int)_speedy >= _pos.y)
|
||||
_pos.y = _walkdata.next.y;
|
||||
}
|
||||
|
||||
if (_walkbox != _walkdata.curbox && _vm->checkXYInBoxBounds(_walkdata.curbox, _pos.x, _pos.y))
|
||||
setBox(_walkdata.curbox);
|
||||
|
||||
distX = ABS(_walkdata.next.x - _walkdata.cur.x);
|
||||
distY = ABS(_walkdata.next.y - _walkdata.cur.y);
|
||||
|
||||
if (ABS(_pos.x - _walkdata.cur.x) >= distX && ABS(_pos.y - _walkdata.cur.y) >= distY) {
|
||||
if ((_vm->_game.version == 3 && _pos == _walkdata.next) || (_vm->_game.version != 3 && ABS(_pos.x - _walkdata.cur.x) >= distX && ABS(_pos.y - _walkdata.cur.y) >= distY)) {
|
||||
_moving &= ~MF_IN_LEG;
|
||||
return 0;
|
||||
}
|
||||
|
@ -1253,9 +1253,16 @@ void Actor_v3::findPathTowardsOld(byte box1, byte box2, byte finalBox, Common::P
|
||||
|
||||
// next box (box2) = final box?
|
||||
if (box2 == finalBox) {
|
||||
// I have commented out the mask check for INDY3 which was meant as a fix for the zeppeline path finding. But it
|
||||
// is wrong and causes issues (e. g. bug #12666 - when Indy starts walking away from the window he will be facing
|
||||
// down instead of right; the mask check is not the cause of all the problems that particular scene had, but at
|
||||
// least some of them). At first glance at disasm it might seem that the original would do such a check, since it
|
||||
// actually calls getMaskFromBox() for both boxes. However, the results do not get evaluated. Looks like some
|
||||
// leftover code...
|
||||
|
||||
// In Indy3, the masks (= z-level) have to match, too -- needed for the
|
||||
// 'maze' in the zeppelin (see bug #1778).
|
||||
if (_vm->_game.id != GID_INDY3 || _vm->getMaskFromBox(box1) == _vm->getMaskFromBox(box2)) {
|
||||
//if (_vm->_game.id != GID_INDY3 || _vm->getMaskFromBox(box1) == _vm->getMaskFromBox(box2)) {
|
||||
// Is the actor (x,y) between both gates?
|
||||
if (compareSlope(_pos, _walkdata.dest, gateA[0]) !=
|
||||
compareSlope(_pos, _walkdata.dest, gateB[0]) &&
|
||||
@ -1263,7 +1270,7 @@ void Actor_v3::findPathTowardsOld(byte box1, byte box2, byte finalBox, Common::P
|
||||
compareSlope(_pos, _walkdata.dest, gateB[1])) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
p3 = closestPtOnLine(gateA[1], gateB[1], _pos);
|
||||
|
Loading…
x
Reference in New Issue
Block a user