diff options
author | Patrick Davison <snapwilliam@gmail.com> | 2012-08-21 15:04:33 -0700 |
---|---|---|
committer | Patrick Davison <snapwilliam@gmail.com> | 2012-08-21 15:04:33 -0700 |
commit | 11a66a1c5d0c1c8a78ee0e33bff822be13dfa955 (patch) | |
tree | a66a90e45b48d07a96aec2c9876a5925d83d18c3 /includes/maps.php | |
parent | 3a1b90cbb7034e285a9e216a4866972dad3288be (diff) | |
download | pathery-11a66a1c5d0c1c8a78ee0e33bff822be13dfa955.tar.xz |
Multipath support for UI
Diffstat (limited to 'includes/maps.php')
-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;
}
-?> +?>
|