map adding

This commit is contained in:
steeffeen
2014-07-05 13:58:35 +02:00
parent 698cb7d146
commit 9fde082a71
3 changed files with 59 additions and 14 deletions

View File

@@ -256,7 +256,12 @@ class MapQueue implements CallbackListener, CommandListener {
}
}
//Check if the map is already juked
// Check if the map is already juked
$map = null;
if ($uid instanceof Map) {
$map = $uid;
$uid = $map->uid;
}
if (array_key_exists($uid, $this->queuedMaps)) {
$this->maniaControl->chat->sendError('That map is already in the Map-Queue!', $login);
return;
@@ -271,7 +276,9 @@ class MapQueue implements CallbackListener, CommandListener {
}
}
$map = $this->maniaControl->mapManager->getMapByUid($uid);
if (!$map) {
$map = $this->maniaControl->mapManager->getMapByUid($uid);
}
$this->queuedMaps[$uid] = array($player, $map);