From 522d7e4a2ada4ab7b3ba35da26a5363e957a417b Mon Sep 17 00:00:00 2001 From: kremsy Date: Mon, 16 Dec 2013 15:08:37 +0100 Subject: [PATCH] small bugfix --- application/core/Maps/MapCommands.php | 9 +++++---- application/core/Maps/MapList.php | 4 ---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/application/core/Maps/MapCommands.php b/application/core/Maps/MapCommands.php index ac933f33..d3a898ec 100644 --- a/application/core/Maps/MapCommands.php +++ b/application/core/Maps/MapCommands.php @@ -19,6 +19,7 @@ class MapCommands implements CommandListener { * Private properties */ private $maniaControl = null; + private $mapList = null; /** * Create MapCommands instance @@ -38,6 +39,8 @@ class MapCommands implements CommandListener { $this->maniaControl->commandManager->registerCommandListener('xlist', $this, 'command_xList'); $this->maniaControl->commandManager->registerCommandListener('list', $this, 'command_List'); $this->maniaControl->commandManager->registerCommandListener('maps', $this, 'command_List'); + + $this->mapList = new MapList($this->maniaControl); } /** @@ -123,8 +126,7 @@ class MapCommands implements CommandListener { * @param Player $player */ public function command_List(array $chatCallback, Player $player) { - $mapList = new MapList($this->maniaControl); - $mapList->showMapList($player); + $this->mapList->showMapList($player); } /** @@ -133,7 +135,6 @@ class MapCommands implements CommandListener { * @param Player $player */ public function command_xList(array $chatCallback, Player $player) { - $mapList = new MapList($this->maniaControl); - $mapList->showManiaExchangeList($chatCallback, $player); + $this->mapList->showManiaExchangeList($chatCallback, $player); } } diff --git a/application/core/Maps/MapList.php b/application/core/Maps/MapList.php index 13cf7ddb..2ec5a9c3 100644 --- a/application/core/Maps/MapList.php +++ b/application/core/Maps/MapList.php @@ -75,8 +75,6 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener { * @param Player $player */ public function showManiaExchangeList(array $chatCallback, Player $player){ - $this->maniaControl->manialinkManager->closeWidget($player); - $params = explode(' ', $chatCallback[1][2]); $serverInfo = $this->maniaControl->server->getSystemInfo(); @@ -214,8 +212,6 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener { * @param Player $player */ public function showMapList(Player $player){ - $this->maniaControl->manialinkManager->closeWidget($player); - $maniaLink = new ManiaLink(ManialinkManager::MAIN_MLID); $frame = $this->buildMainFrame(); $maniaLink->add($frame);