summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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]);