diff options
Diffstat (limited to 'includes/mapclass.php')
-rw-r--r-- | includes/mapclass.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/includes/mapclass.php b/includes/mapclass.php index 9e91d3f..bc5a6e5 100644 --- a/includes/mapclass.php +++ b/includes/mapclass.php @@ -43,8 +43,15 @@ class map { public function __construct($code = NULL, $mapID = NULL) { //TODO: Use new code by default. if ($mapID !== NULL) $this->ID = $mapID; - if ($code !== NULL) $this->applyMapFromOldCode($code); - //$this->applyMapFromCode($code); + if ($code !== NULL) { + $dimensions = explode('.', explode(':', $code)[0])[0]; + if (strpos($dimensions, 'x') == true) { + $this->applyMapFromOldCode($code); + } else { + $this->applyMapFromCode($code); + } + } + } public function applyMapFromOldCode($code) { @@ -218,8 +225,7 @@ class map { //Outputs the new code. public function getCode() { //If we already have the code on hand... - if ($this->code) - return $this->code; + //if ($this->code) return $this->code; //Otherwise we need to build the code: $headers[0] = $this->width; $headers[1] = $this->height; |