diff options
Diffstat (limited to 'do.php')
-rw-r--r-- | do.php | 18 |
1 files changed, 2 insertions, 16 deletions
@@ -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?
|