diff --git a/application/core/Maps/MapManager.php b/application/core/Maps/MapManager.php index 61f361ed..7bbb83dc 100644 --- a/application/core/Maps/MapManager.php +++ b/application/core/Maps/MapManager.php @@ -562,10 +562,7 @@ class MapManager implements CallbackListener { * Restructures the Maplist */ public function restructureMapList() { - $currentIndex = 0; - if ($this->currentMap) { - $currentIndex = $this->getMapIndex($this->currentMap); - } + $currentIndex = $this->getMapIndex($this->getCurrentMap()); // No RestructureNeeded if ($currentIndex < Maplist::MAX_MAPS_PER_PAGE - 1) { @@ -625,6 +622,18 @@ class MapManager implements CallbackListener { return array_slice($this->maps, $offset, $length); } + /** + * Get Current Map + * + * @return Map + */ + public function getCurrentMap() { + if (!$this->currentMap) { + return $this->fetchCurrentMap(); + } + return $this->currentMap; + } + /** * Handle OnInit callback */ @@ -644,18 +653,6 @@ class MapManager implements CallbackListener { $this->mxManager->fetchManiaExchangeMapInformation(); } - /** - * Get Current Map - * - * @return Map - */ - public function getCurrentMap() { - if (!$this->currentMap) { - return $this->fetchCurrentMap(); - } - return $this->currentMap; - } - /** * Handle Script BeginMap callback *