From b8a3192e6dd3656fe753098a99325556b130c6a9 Mon Sep 17 00:00:00 2001 From: kremsy Date: Fri, 21 Mar 2014 10:52:40 +0100 Subject: [PATCH] mapdir fix --- application/core/Maps/MapManager.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/application/core/Maps/MapManager.php b/application/core/Maps/MapManager.php index 3ed851a9..236a0d66 100644 --- a/application/core/Maps/MapManager.php +++ b/application/core/Maps/MapManager.php @@ -570,13 +570,13 @@ class MapManager implements CallbackListener { return; } //Download the file - $this->maniaControl->fileReader->loadFile($mapInfo->downloadurl, function ($file, $error) use (&$login, &$mapInfo, &$mapDir, &$update) { + $this->maniaControl->fileReader->loadFile($mapInfo->downloadurl, function ($file, $error) use (&$login, &$mapInfo, &$update) { if (!$file) { // Download error $this->maniaControl->chat->sendError('Download failed!', $login); return; } - $this->processMapFile($file, $mapInfo, $mapDir, $login, $update); + $this->processMapFile($file, $mapInfo, $login, $update); }); }); } @@ -587,11 +587,12 @@ class MapManager implements CallbackListener { * * @param $file * @param MXMapInfo $mapInfo - * @param $mapDir * @param $login * @param $update */ - private function processMapFile($file, MXMapInfo $mapInfo, $mapDir, $login, $update) { + private function processMapFile($file, MXMapInfo $mapInfo, $login, $update) { + $mapDir = $this->maniaControl->client->getMapsDirectory(); + //Check if map is already on the server if ($this->getMapByUid($mapInfo->uid) != null) { // Download error