From aed9779afb75e689263fe5867076e877ac6e4493 Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Wed, 30 Jan 2013 01:10:09 -0800 Subject: Mapclass->checkpoints/teleports are now accurate. --- includes/mapclass.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'includes/mapclass.php') 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]); -- cgit v1.2.3