summaryrefslogtreecommitdiffstats
path: root/do.php
diff options
context:
space:
mode:
Diffstat (limited to 'do.php')
-rw-r--r--do.php18
1 files changed, 2 insertions, 16 deletions
diff --git a/do.php b/do.php
index d574031..c82de22 100644
--- a/do.php
+++ b/do.php
@@ -154,23 +154,9 @@ if ($_GET['r'] == 'getpath') {
$mygrid = MergeMapSolution($map, $solution);
//Check both starting point groups for paths
- $moves = 0;
- $json['blocked'] = false;
- $containsNormalStart = (findTiles($mygrid, "s") !== false);
- $containsReverseStart = (findTiles($mygrid, "S") !== false);
- if($containsNormalStart)
- {
- $json['path'][0] = routePath($mygrid);
- $moves += $json['path'][0]['moves'];
- $json['blocked'] = $json['path'][0]['blocked'];
- }
- if($containsReverseStart)
- {
- $json['path'][1] = routePath($mygrid, false, true);
- $moves += $json['path'][1]['moves'];
- $json['blocked'] = $json['path'][1]['blocked'] || $json['blocked'];
- }
+ $json = routeMultiPath($mygrid);
+ $moves = $json['totalMoves'];
$json['mapid'] = $mapID;
//What could go wrong?