diff options
author | Patrick Davison <snapwilliam@gmail.com> | 2011-11-27 03:16:33 -0800 |
---|---|---|
committer | Patrick Davison <snapwilliam@gmail.com> | 2011-11-27 03:16:33 -0800 |
commit | 70672bb87408b4186537ee2c455259312cd4e806 (patch) | |
tree | 5a318b1b7bab6878bf9bdfb32ef3c08bd6caf8cf /includes/maps.php | |
parent | 8c29ba84cc98b60a20e8e79db37eeb607dc7a6db (diff) | |
download | pathery-70672bb87408b4186537ee2c455259312cd4e806.tar.xz |
Fix for broken start location.
PHP improperly duplicates $v?
Diffstat (limited to 'includes/maps.php')
-rw-r--r-- | includes/maps.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/includes/maps.php b/includes/maps.php index d50175a..4ff205f 100644 --- a/includes/maps.php +++ b/includes/maps.php @@ -747,12 +747,17 @@ function findPath($mapMatrix, $start = '0,1', $target = 'f') { $v = explode(",", $v);
$v[2] = $v[0].','.$v[1];
$v[3] = '';
+
+ //Remove Seeds as potential seeding slots.
+ $x = $v[0];
+ $y = $v[1];
+ unset($mapMatrix[$y][$x]);
}
$index = count($seed);
do {
- foreach ($seed as $key => $v) {
+ foreach ($seed as $key => &$v) {
//Search the squares around, to spread the seeds
for($i = 1; $i <= 4; $i++) {
$x = $v[0];
|