[Scummvm-git-logs] scummvm master -> d719e83783a530e6e272ddd0207edaf33fb37ed0

athrxx noreply at scummvm.org
Sat Apr 2 16:27:23 UTC 2022


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:
d719e83783 SCUMM: fix bug no. 13366


Commit: d719e83783a530e6e272ddd0207edaf33fb37ed0
    https://github.com/scummvm/scummvm/commit/d719e83783a530e6e272ddd0207edaf33fb37ed0
Author: athrxx (athrxx at scummvm.org)
Date: 2022-04-02T18:26:46+02:00

Commit Message:
SCUMM: fix bug no. 13366

(Loom (EGA) - Path finding or overlay issue at Dragon's caves)

Changed paths:
    engines/scumm/boxes.cpp


diff --git a/engines/scumm/boxes.cpp b/engines/scumm/boxes.cpp
index 0d05603cb32..00c263e1235 100644
--- a/engines/scumm/boxes.cpp
+++ b/engines/scumm/boxes.cpp
@@ -541,13 +541,24 @@ bool ScummEngine::checkXYInBoxBounds(int boxnum, int x, int y) {
 	// Corner case: If the box is a simple line segment, we consider the
 	// point to be contained "in" (or rather, lying on) the line if it
 	// is very close to its projection to the line segment.
-	if ((box.ul == box.ur && box.lr == box.ll) ||
-		(box.ul == box.ll && box.ur == box.lr)) {
-
-		Common::Point tmp;
-		tmp = closestPtOnLine(box.ul, box.lr, p);
-		if (p.sqrDist(tmp) <= 4)
-			return true;
+	// Update: It can cause bugs like #13366 if used for games where this
+	// code isn't actually present in the original interpreter. I have
+	// checked disasm for LOOM FM-TOWNS and DOS EGA, ZAK FM-TOWNS, INDY3
+	// FM-TOWNS and DOS VGA and also LOOM DOS VGA (v4). MI2 does have the
+	// these lines, so that's probably the origin of our code. So it seems
+	// safe to assume that it does not belong in any game before SCUMM5.
+	// I have also checked ZAK DOS to verify that the earliy games don't
+	// even have/use the whole function checkXYInBoxBounds(), so we're
+	// doing that correctly.
+	if (_game.version > 4) {
+		if ((box.ul == box.ur && box.lr == box.ll) ||
+			(box.ul == box.ll && box.ur == box.lr)) {
+
+			Common::Point tmp;
+			tmp = closestPtOnLine(box.ul, box.lr, p);
+			if (p.sqrDist(tmp) <= 4)
+				return true;
+		}
 	}
 
 	// Finally, fall back to the classic algorithm to compute containment




More information about the Scummvm-git-logs mailing list