Fixed some Queue problems

This commit is contained in:
Max Klaversma 2014-01-25 20:00:41 +01:00 committed by Steffen Schröder
parent b66603a8f7
commit f3be18510a

View File

@ -192,6 +192,9 @@ class QueuePlugin implements CallbackListener, CommandListener, ManialinkPageAns
$this->spectators[$player->login] = $player->login; $this->spectators[$player->login] = $player->login;
$this->showJoinQueueWidget($player); $this->showJoinQueueWidget($player);
} }
} else {
$this->removePlayerFromQueue($player->login);
if(isset($this->spectators[$player->login])) unset($this->spectators[$player->login]);
} }
} }
} }
@ -200,7 +203,7 @@ class QueuePlugin implements CallbackListener, CommandListener, ManialinkPageAns
* Function called on every second. * Function called on every second.
*/ */
public function handleEverySecond() { public function handleEverySecond() {
if($this->maniaControl->client->getMaxPlayers()['CurrentValue'] > count($this->maniaControl->playerManager->players)) { if($this->maniaControl->client->getMaxPlayers()['CurrentValue'] > (count($this->maniaControl->playerManager->players)-count($this->spectators))) {
$this->moveFirstPlayerToPlay(); $this->moveFirstPlayerToPlay();
} }