[Scummvm-cvs-logs] scummvm master -> 1800f9d8dc26e177ac53be3e2cda0a5c19593dc0

johndoe123 benjamin.haisch at t-online.de
Mon Nov 23 13:26:42 CET 2015

This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

1800f9d8dc BBVS: Fix bug #6954: Pathfinding bug in Prison

Commit: 1800f9d8dc26e177ac53be3e2cda0a5c19593dc0
Author: johndoe123 (john_doe at techie.com)
Date: 2015-11-23T13:22:51+01:00

Commit Message:
BBVS: Fix bug #6954: Pathfinding bug in Prison

The bug was caused by a check introduced by me to avoid division-by-zero errors
when the source and dest x values are equal.
This had the side effect that it didn't work well in this case outlined in the
bug report, maybe also in other places.
I'm not sure how to handle a DBZ correctly here so I'm setting the x delta to
1.0 if it would normally be 0.0, which seems to work after walking around
in some scenes.

Changed paths:

diff --git a/engines/bbvs/walk.cpp b/engines/bbvs/walk.cpp
index 5ef1410..e97182f 100644
--- a/engines/bbvs/walk.cpp
+++ b/engines/bbvs/walk.cpp
@@ -326,12 +326,10 @@ void BbvsEngine::canWalkToDest(WalkArea *walkArea, int infoCount) {
 bool BbvsEngine::walkTestLineWalkable(const Common::Point &sourcePt, const Common::Point &destPt, WalkInfo *walkInfo) {
-	const float ptDeltaX = destPt.x - sourcePt.x;
+	const float ptDeltaX = MAX<float>(destPt.x - sourcePt.x, 1.0f);
 	const float ptDeltaY = destPt.y - sourcePt.y;
 	const float wDeltaX = walkInfo->x - sourcePt.x;
 	const float wDeltaY = walkInfo->y - sourcePt.y;
-	if (destPt.x == sourcePt.x)
-		return true;
 	if (walkInfo->direction) {
 		const float nDeltaY = wDeltaX * ptDeltaY / ptDeltaX + (float)sourcePt.y - (float)walkInfo->y;
 		return (nDeltaY >= 0.0f) && (nDeltaY < (float)walkInfo->delta);

More information about the Scummvm-git-logs mailing list