[Scummvm-cvs-logs] SF.net SVN: scummvm:[46287] scummvm/trunk/engines/teenagent/objects.h

megath at users.sourceforge.net megath at users.sourceforge.net
Mon Dec 7 23:11:46 CET 2009


Revision: 46287
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46287&view=rev
Author:   megath
Date:     2009-12-07 22:11:45 +0000 (Mon, 07 Dec 2009)

Log Message:
-----------
finally fixed pathfinding

Modified Paths:
--------------
    scummvm/trunk/engines/teenagent/objects.h

Modified: scummvm/trunk/engines/teenagent/objects.h
===================================================================
--- scummvm/trunk/engines/teenagent/objects.h	2009-12-07 21:59:50 UTC (rev 46286)
+++ scummvm/trunk/engines/teenagent/objects.h	2009-12-07 22:11:45 UTC (rev 46287)
@@ -94,12 +94,12 @@
 		
 		if (dx != 0) {
 			int yl = (left - a.x) * dy / dx + a.y;
-			if (yl > top && yl < bottom && inside(yl, a.y, b.y)) {
+			if (yl > top && yl < bottom && inside(yl, a.y, b.y) && inside(left, a.x, b.x)) {
 				//c[idx++] = Common::Point(left, yl);
 				mask |= 8;
 			}
 			int yr = (right - a.x) * dy / dx + a.y;
-			if (yr > top && yr < bottom && inside(yr, a.y, b.y)) {
+			if (yr > top && yr < bottom && inside(yr, a.y, b.y) && inside(right, a.x, b.x)) {
 				//c[idx++] = Common::Point(right, yr);
 				mask |= 2;
 			}
@@ -107,13 +107,13 @@
 		
 		if (dy != 0) {
 			int xt = (top - a.y) * dx / dy + a.x;
-			if (xt > left && xt < right && inside(xt, a.x, b.x)) {
+			if (xt > left && xt < right && inside(xt, a.x, b.x) && inside(top, a.y, b.y)) {
 				//assert(idx < 2);
 				//c[idx++] = Common::Point(xt, top);
 				mask |= 1;
 			}
 			int xb = (bottom - a.y) * dx / dy + a.x;
-			if (xb > left && xb < right && inside(xb, a.x, b.x)) {
+			if (xb > left && xb < right && inside(xb, a.x, b.x) && inside(bottom, a.y, b.y)) {
 				//assert(idx < 2);
 				//c[idx++] = Common::Point(xb, bottom);
 				mask |= 4;


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