From 6554ac5bcacd25b6062d298a0e0b7ed6982282ba Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Fri, 22 Apr 2011 12:32:53 -0700 Subject: Added map "Seeing Double" to Saturday. Fixed an issue with pathing related to multiple checkpoints and a teleport. --- includes/mapoftheday.php | 2 +- includes/maps.php | 30 ++++++++---------------------- pages/home.php | 2 +- 3 files changed, 10 insertions(+), 24 deletions(-) diff --git a/includes/mapoftheday.php b/includes/mapoftheday.php index cd646cb..62b44a4 100644 --- a/includes/mapoftheday.php +++ b/includes/mapoftheday.php @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/includes/maps.php b/includes/maps.php index 0329e18..8cee2b3 100644 --- a/includes/maps.php +++ b/includes/maps.php @@ -770,64 +770,48 @@ function GetTile($mapMatrix, $id) // [path] path-string. [blocked] boolean, [moves] int. function routePath($mygrid, $start = '') { - //== This should grab the start positions by scaning the map. - //if ($start == '') { - // for ($i = 1; $i <= $mygrid[0][1]; $i++) { - // $start .= "0,$i."; - // } - //} + //Locate the start locations. $start = findTiles($mygrid, "s"); - - //echo $start; //Checkpoint names $cpnames = Array("a", "b", "c", "d", "e"); - //== Relies on the map headers being accurate. //Get the amount of checkpoints on this map. - //$cpcount = $mygrid[0][2]; $cpcount = 0; - //Get the amount of checkpoints on this map. foreach ($cpnames as $cpt) if (findTiles($mygrid, $cpt)) $cpcount++; - //Add the existing checkpoints to targets. + //Add the existing checkpoints to target array. for($p = 0; $p < $cpcount; $p++) { $target[] = $cpnames[$p]; } - //Always need the finish line. + //Our last target is the finish line. $target[] = 'f'; //Assume that we're not blocked, and raise a red flag later. $blocked = false; - //All possible teleports in play. $tpnames = Array('t', 'm', 'g', 'i', 'k'); - + //Find all the existing teleports. $tpcount = 0; foreach ($tpnames as $tpt) if (findTiles($mygrid, $tpt)) $tpcount++; - //$tpcount = intval($mygrid[0][5] * .5); - - - //Add the existing checkpoints to targets. + //Save the existing teleports, to check for them later. for($p = 0; $p < $tpcount; $p++) { $teleport[] = $tpnames[$p]; } + //Where there's an in, there's an out. $teleout['t'] = 'u'; $teleout['m'] = 'n'; $teleout['g'] = 'h'; $teleout['i'] = 'j'; $teleout['k'] = 'l'; - //$r['tparray'] = $teleport; - //$r['cparray'] = $target; - //Loop through all the targets. foreach($target as $t) { //Path from where we are, to the target. @@ -896,6 +880,8 @@ function routePath($mygrid, $start = '') { //123 U CORDS U //123 U CORDS U 2322 $p['path'] .= $z['path']; + //Our end point may have been modified. + $p['end'] = $z['end']; $movesoffset -= countmoves($out); //} diff --git a/pages/home.php b/pages/home.php index 4a034c3..a6d73d6 100644 --- a/pages/home.php +++ b/pages/home.php @@ -108,7 +108,7 @@ switch ($numday) { $mapstyle = 'Side to Side'; break; case 6: //Saturday - $mapstyle = "ABC's"; + $mapstyle = "Seeing Double"; break; } -- cgit v1.2.3