]> Dogcows Code - chaz/carfire/blobdiff - CarFire/CarFire/CarFire/PathFinder.cs
git-svn-id: https://bd85.net/svn/cs3505_group@152 92bb83a3-7c8f-8a45-bc97-515c4e399668
[chaz/carfire] / CarFire / CarFire / CarFire / PathFinder.cs
index c37e51863d7ad4b4abe9b18c707de8a8126fcaf8..02c645cc8f8ed4c71e20705b96951a627acd15b4 100644 (file)
@@ -152,13 +152,12 @@ namespace CarFire
 #endif\r
                 foreach (Point point in neighbors)\r
                 {\r
-                    Cell inQueue = mCells[point.X, point.Y];\r
-\r
                     if (0 <= point.X && point.X < mGridWidth && 0 <= point.Y && point.Y < mGridHeight &&\r
                         mGrid[point.X, point.Y])\r
                     {\r
                         int cost = cell.G + costFunction(cell.Point, point);\r
 \r
+                        Cell inQueue = mCells[point.X, point.Y];\r
                         if (inQueue == null)\r
                         {\r
                             Cell neighbor = new Cell(point, cost, heuristic(point, finish), cell);\r
This page took 0.019195 seconds and 4 git commands to generate.