maplist fix

This commit is contained in:
kremsy 2014-02-26 15:19:44 +01:00 committed by Steffen Schröder
parent fea5e1cd82
commit 47809cd1c5

View File

@ -251,7 +251,7 @@ class MapManager implements CallbackListener {
$currentIndex = $this->getMapIndex($this->currentMap); $currentIndex = $this->getMapIndex($this->currentMap);
//No RestructureNeeded //No RestructureNeeded
if ($currentIndex < 14) { if ($currentIndex < Maplist::MAX_MAPS_PER_PAGE - 1) {
return true; return true;
} }
@ -260,7 +260,6 @@ class MapManager implements CallbackListener {
$i = 0; $i = 0;
foreach($this->maps as $map) { foreach($this->maps as $map) {
/** @var Map $map */
if ($i < $currentIndex) { if ($i < $currentIndex) {
$lowerMapArray[] = $map->fileName; $lowerMapArray[] = $map->fileName;
} else { } else {
@ -270,6 +269,7 @@ class MapManager implements CallbackListener {
} }
$mapArray = array_merge($higherMapArray, $lowerMapArray); $mapArray = array_merge($higherMapArray, $lowerMapArray);
array_shift($mapArray);
try { try {
$this->maniaControl->client->chooseNextMapList($mapArray); $this->maniaControl->client->chooseNextMapList($mapArray);