diff --git a/application/plugins/QueuePlugin.php b/application/plugins/QueuePlugin.php index 25235c9a..ffec0012 100644 --- a/application/plugins/QueuePlugin.php +++ b/application/plugins/QueuePlugin.php @@ -232,7 +232,8 @@ 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) - count($this->spectators))) { + $maxPlayers = $this->maniaControl->client->getMaxPlayers(); + if($maxPlayers['CurrentValue'] > (count($this->maniaControl->playerManager->players) - count($this->spectators))) { $this->moveFirstPlayerToPlay(); } @@ -287,7 +288,8 @@ class QueuePlugin implements CallbackListener, CommandListener, ManialinkPageAns * @param Player $player */ private function forcePlayerToPlay(Player $player) { - if($this->maniaControl->client->getMaxPlayers()['CurrentValue'] > (count($this->maniaControl->playerManager->players) - count($this->spectators))) { + $maxPlayers = $this->maniaControl->client->getMaxPlayers(); + if($maxPlayers['CurrentValue'] > (count($this->maniaControl->playerManager->players) - count($this->spectators))) { try { $this->maniaControl->client->forceSpectator($player->login, 2); } catch(Exception $e) {