improved error prevention
This commit is contained in:
parent
8c5b7b4b14
commit
1c94e2da27
@ -562,10 +562,7 @@ class MapManager implements CallbackListener {
|
|||||||
* Restructures the Maplist
|
* Restructures the Maplist
|
||||||
*/
|
*/
|
||||||
public function restructureMapList() {
|
public function restructureMapList() {
|
||||||
$currentIndex = 0;
|
$currentIndex = $this->getMapIndex($this->getCurrentMap());
|
||||||
if ($this->currentMap) {
|
|
||||||
$currentIndex = $this->getMapIndex($this->currentMap);
|
|
||||||
}
|
|
||||||
|
|
||||||
// No RestructureNeeded
|
// No RestructureNeeded
|
||||||
if ($currentIndex < Maplist::MAX_MAPS_PER_PAGE - 1) {
|
if ($currentIndex < Maplist::MAX_MAPS_PER_PAGE - 1) {
|
||||||
@ -625,6 +622,18 @@ class MapManager implements CallbackListener {
|
|||||||
return array_slice($this->maps, $offset, $length);
|
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
|
* Handle OnInit callback
|
||||||
*/
|
*/
|
||||||
@ -644,18 +653,6 @@ class MapManager implements CallbackListener {
|
|||||||
$this->mxManager->fetchManiaExchangeMapInformation();
|
$this->mxManager->fetchManiaExchangeMapInformation();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Current Map
|
|
||||||
*
|
|
||||||
* @return Map
|
|
||||||
*/
|
|
||||||
public function getCurrentMap() {
|
|
||||||
if (!$this->currentMap) {
|
|
||||||
return $this->fetchCurrentMap();
|
|
||||||
}
|
|
||||||
return $this->currentMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle Script BeginMap callback
|
* Handle Script BeginMap callback
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user