diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/maps.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/includes/maps.php b/includes/maps.php index 474a2ad..f49900f 100644 --- a/includes/maps.php +++ b/includes/maps.php @@ -888,19 +888,21 @@ function routePath($mygrid, $start = '', $validate = false) { if (in_array("S", $tileLocations)) {
}
-
+ $pathx = false;
// Tmp bad code..
- if ($start == 'X')
+ if ($start == 'X') {
+ $pathx = true;
$start = findTiles($mygrid, "S");
- else
+ } else
$start = findTiles($mygrid, "s");
//Checkpoint names
$cpnames = array("a", "b", "c", "d", "e");
-
+ if ($pathx)
+ $cpnames = array("e", "d", "c", "b", "a");
//!! Improve the 'findTiles' function to prevent duplicate itterations.
//Add the existing checkpoints to target array.
@@ -1065,4 +1067,4 @@ function findTilesM ($mapMatrix, $search) { return $r;
}
-?> +?>
|