[Scummvm-cvs-logs] SF.net SVN: scummvm:[53790] scummvm/trunk/engines/gob/map.cpp
drmccoy at users.sourceforge.net
drmccoy at users.sourceforge.net
Mon Oct 25 05:38:12 CEST 2010
Revision: 53790
http://scummvm.svn.sourceforge.net/scummvm/?rev=53790&view=rev
Author: drmccoy
Date: 2010-10-25 03:38:12 +0000 (Mon, 25 Oct 2010)
Log Message:
-----------
GOB: Fix a typo in checkDirectPath()
Modified Paths:
--------------
scummvm/trunk/engines/gob/map.cpp
Modified: scummvm/trunk/engines/gob/map.cpp
===================================================================
--- scummvm/trunk/engines/gob/map.cpp 2010-10-25 03:37:48 UTC (rev 53789)
+++ scummvm/trunk/engines/gob/map.cpp 2010-10-25 03:38:12 UTC (rev 53790)
@@ -352,20 +352,20 @@
int16 Map::checkDirectPath(Mult::Mult_Object *obj,
int16 x0, int16 y0, int16 x1, int16 y1) {
- uint16 dir;
while (1) {
- dir = getDirection(x0, y0, x1, y1);
+ uint16 dir = getDirection(x0, y0, x1, y1);
if (obj) {
- if (obj->nearestWayPoint < obj->nearestDest) {
- if (_wayPoints[obj->nearestWayPoint + 1].notWalkable == 1)
- return 3;
- } else if (obj->nearestWayPoint > obj->nearestDest) {
- if (obj->nearestDest > 0)
- if (_wayPoints[obj->nearestDest - 1].notWalkable == 1)
+ if (obj->nearestWayPoint < obj->nearestDest)
+ if ((obj->nearestWayPoint + 1) < _wayPointsCount)
+ if (_wayPoints[obj->nearestWayPoint + 1].notWalkable == 1)
return 3;
- }
+
+ if (obj->nearestWayPoint > obj->nearestDest)
+ if (obj->nearestWayPoint > 0)
+ if (_wayPoints[obj->nearestWayPoint - 1].notWalkable == 1)
+ return 3;
}
if ((x0 == x1) && (y0 == y1))
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