From f3be18510a14df022c135cb3914b9f515ecc58c5 Mon Sep 17 00:00:00 2001 From: Max Klaversma Date: Sat, 25 Jan 2014 20:00:41 +0100 Subject: [PATCH] Fixed some Queue problems --- application/plugins/QueuePlugin.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/plugins/QueuePlugin.php b/application/plugins/QueuePlugin.php index 0251c675..0b0ce840 100644 --- a/application/plugins/QueuePlugin.php +++ b/application/plugins/QueuePlugin.php @@ -192,6 +192,9 @@ class QueuePlugin implements CallbackListener, CommandListener, ManialinkPageAns $this->spectators[$player->login] = $player->login; $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. */ 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(); }