[Scummvm-cvs-logs] SF.net SVN: scummvm:[54230] scummvm/trunk/engines/sci/engine/kpathing.cpp

waltervn at users.sourceforge.net waltervn at users.sourceforge.net
Sat Nov 13 15:46:29 CET 2010


Revision: 54230
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54230&view=rev
Author:   waltervn
Date:     2010-11-13 14:46:27 +0000 (Sat, 13 Nov 2010)

Log Message:
-----------
SCI: Fixup pathfinding start point when on polygon edge.

We now also fixup the start point when it's on the edge of an obstacle. If the
start point is also on the edge of the screen, the actor is now allowed to
walk through that obstacle to find his way to clear territory. This is based
on observation of SSCI behavior.

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kpathing.cpp

Modified: scummvm/trunk/engines/sci/engine/kpathing.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kpathing.cpp	2010-11-13 13:45:09 UTC (rev 54229)
+++ scummvm/trunk/engines/sci/engine/kpathing.cpp	2010-11-13 14:46:27 UTC (rev 54230)
@@ -938,7 +938,7 @@
 			// Fall through
 		case POLY_BARRED_ACCESS:
 		case POLY_NEAREST_ACCESS:
-			if (cont == CONT_INSIDE) {
+			if (cont != CONT_OUTSIDE) {
 				if (s->_prependPoint != NULL) {
 					// We shouldn't get here twice.
 					// We need to break in this case, otherwise we'll end in an infinite
@@ -958,7 +958,8 @@
 				// The original start position is in an invalid location, so we
 				// use the moved point and add the original one to the final path
 				// later on.
-				s->_prependPoint = new Common::Point(start);
+				if (start != *new_start)
+					s->_prependPoint = new Common::Point(start);
 			}
 		}
 
@@ -1014,7 +1015,7 @@
 
 				// For near-point access polygons we need to add the original end point
 				// to the path after pathfinding.
-				if (type == POLY_NEAREST_ACCESS)
+				if ((type == POLY_NEAREST_ACCESS) && (end != *new_end))
 					s->_appendPoint = new Common::Point(end);
 			}
 		}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list