[Scummvm-cvs-logs] SF.net SVN: scummvm:[53792] scummvm/trunk/engines/gob/map_v2.cpp
drmccoy at users.sourceforge.net
drmccoy at users.sourceforge.net
Mon Oct 25 05:39:04 CEST 2010
Revision: 53792
http://scummvm.svn.sourceforge.net/scummvm/?rev=53792&view=rev
Author: drmccoy
Date: 2010-10-25 03:39:04 +0000 (Mon, 25 Oct 2010)
Log Message:
-----------
GOB: Format optimizePoints() to be a bit more readable
Modified Paths:
--------------
scummvm/trunk/engines/gob/map_v2.cpp
Modified: scummvm/trunk/engines/gob/map_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/map_v2.cpp 2010-10-25 03:38:34 UTC (rev 53791)
+++ scummvm/trunk/engines/gob/map_v2.cpp 2010-10-25 03:39:04 UTC (rev 53792)
@@ -258,17 +258,24 @@
void Map_v2::optimizePoints(Mult::Mult_Object *obj, int16 x, int16 y) {
if (obj->nearestWayPoint < obj->nearestDest) {
+
for (int i = obj->nearestWayPoint; i <= obj->nearestDest; i++) {
if (checkDirectPath(obj, x, y, _wayPoints[i].x, _wayPoints[i].y) == 1)
obj->nearestWayPoint = i;
}
+
} else {
- for (int i = obj->nearestWayPoint;
- i >= obj->nearestDest && (_wayPoints[i].notWalkable != 1); i--) {
+
+ for (int i = obj->nearestWayPoint; i >= obj->nearestDest; i++) {
+ if (_wayPoints[i].notWalkable == 1)
+ break;
+
if (checkDirectPath(obj, x, y, _wayPoints[i].x, _wayPoints[i].y) == 1)
obj->nearestWayPoint = i;
}
+
}
+
}
} // End of namespace Gob
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