From 11a66a1c5d0c1c8a78ee0e33bff822be13dfa955 Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Tue, 21 Aug 2012 15:04:33 -0700 Subject: Multipath support for UI --- includes/maps.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'includes') 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; } -?> +?> -- cgit v1.2.3