summaryrefslogtreecommitdiffstats
path: root/includes
diff options
context:
space:
mode:
authorPatrick Davison <snapwilliam@gmail.com>2013-01-30 01:10:09 -0800
committerPatrick Davison <snapwilliam@gmail.com>2013-01-30 01:10:09 -0800
commitaed9779afb75e689263fe5867076e877ac6e4493 (patch)
tree1c7d4f22e0a068a89efda39cfc72d85148401c62 /includes
parentf18df1575490d83293fddb79d389ef170bbb5a2c (diff)
downloadpathery-aed9779afb75e689263fe5867076e877ac6e4493.tar.xz
Mapclass->checkpoints/teleports are now accurate.
Diffstat (limited to 'includes')
-rw-r--r--includes/mapclass.php27
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]);