From e51670a2ac08da2ebf70ccfcd72ddb8baf729fc3 Mon Sep 17 00:00:00 2001 From: Max Klaversma Date: Thu, 13 Feb 2014 19:03:06 +0100 Subject: [PATCH] Fixed compatibility for queue with PHP5.3 --- application/plugins/QueuePlugin.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) {