diff options
author | Patrick Davison <snapwilliam@gmail.com> | 2013-01-30 01:10:09 -0800 |
---|---|---|
committer | Patrick Davison <snapwilliam@gmail.com> | 2013-01-30 01:10:09 -0800 |
commit | aed9779afb75e689263fe5867076e877ac6e4493 (patch) | |
tree | 1c7d4f22e0a068a89efda39cfc72d85148401c62 | |
parent | f18df1575490d83293fddb79d389ef170bbb5a2c (diff) | |
download | pathery-aed9779afb75e689263fe5867076e877ac6e4493.tar.xz |
Mapclass->checkpoints/teleports are now accurate.
-rw-r--r-- | includes/mapclass.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/includes/mapclass.php b/includes/mapclass.php index ce9dc1b..d086137 100644 --- a/includes/mapclass.php +++ b/includes/mapclass.php @@ -116,6 +116,20 @@ class map { $this->tiles[$y][$x][TileType] = $type; $this->tiles[$y][$x][TileValue] = $value; + + //Checkpoint values + if ($value == '') $value = 1; + if ($type == TileCheckpoint) { + if ($this->checkpoints < $value) { + $this->checkpoints = $value; + } + } + if ($type == TileTeleportIn) { + if ($this->teleports < $value) { + $this->teleports = $value; + } + } + $index++; //Start from 0 again. $t = -1; @@ -172,6 +186,19 @@ class map { $this->tiles[$y][$x][TileType] = $type; $this->tiles[$y][$x][TileValue] = $value; + if ($value == '') $value = 1; + if ($type == TileCheckpoint) { + if ($this->checkpoints < $value) { + $this->checkpoints = $value; + } + } + + if ($type == TileTeleportIn) { + if ($this->teleports < $value) { + $this->teleports = $value; + } + } + //Next Element $index++; $codePart = explode(',', $splitCode[$index]); |