[Scummvm-git-logs] scummvm master -> 7295854df73e6efcc822c62b9618d034d0134c98
sluicebox
22204938+sluicebox at users.noreply.github.com
Mon Aug 16 23:15:48 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:
7295854df7 SCI: Add LB2 staircase pathfinding workaround
Commit: 7295854df73e6efcc822c62b9618d034d0134c98
https://github.com/scummvm/scummvm/commit/7295854df73e6efcc822c62b9618d034d0134c98
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2021-08-16T18:14:09-05:00
Commit Message:
SCI: Add LB2 staircase pathfinding workaround
Fixes ego never walking down the museum staircase due to differences
in our pathfinding algorithm.
I don't know if there is a general change to our algorithm that could
take care of this, but given that both points are within multiple
barred access polygons this might be something that just happened to
work in the original.
Either way, we're close to a release so I only want to address this
specific issue.
Changed paths:
engines/sci/engine/kpathing.cpp
diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp
index b9782ce6f6..fabedd7d65 100644
--- a/engines/sci/engine/kpathing.cpp
+++ b/engines/sci/engine/kpathing.cpp
@@ -1005,7 +1005,25 @@ static Common::Point *fixup_start_point(PathfindingState *s, const Common::Point
// We need to break in this case, otherwise we'll end in an infinite
// loop.
warning("AvoidPath: start point is contained in multiple polygons");
- break;
+
+ // WORKAROUND: LB2 room 530 has two barred access polygons obstacles with
+ // the second completely contained in the first. To walk down the stairs,
+ // the script places ego within the inner polygon to walk along a path
+ // that's also contained by both polygons. Our algorithm fixes up the
+ // start point against the first polygon that contains it, and so the
+ // staircase polygon is ignored. Instead ego's start position is set just
+ // outside the first (outer) polygon. The destination is then unreachable
+ // and so the script proceeds without ego ever walking down the stairs.
+ // The workaround is to ignore the fixup against the first polygon.
+ bool ignoreEarlierPolygon = g_sci->getGameId() == GID_LAURABOW2 &&
+ g_sci->getEngineState()->currentRoomNumber() == 530 &&
+ (*it)->vertices.size() == 14;
+ if (ignoreEarlierPolygon) {
+ delete s->_prependPoint;
+ s->_prependPoint = NULL;
+ } else {
+ break;
+ }
}
if (s->findNearPoint(start, (*it), new_start) != PF_OK) {
More information about the Scummvm-git-logs
mailing list