From 49cc059e66ae812c7f84bd73cdc2f45ab1d97f9f Mon Sep 17 00:00:00 2001 From: kremsy Date: Wed, 23 Apr 2014 15:11:46 +0200 Subject: [PATCH] mapmanager fix --- application/core/Maps/MapManager.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/application/core/Maps/MapManager.php b/application/core/Maps/MapManager.php index 8d07fbb6..0c9c6680 100644 --- a/application/core/Maps/MapManager.php +++ b/application/core/Maps/MapManager.php @@ -240,9 +240,9 @@ class MapManager implements CallbackListener { } // Remove map - try{ + try { $this->maniaControl->client->removeMap($map->fileName); - }catch(MapNotInCurrentSelectionException $e){ + } catch(MapNotInCurrentSelectionException $e) { } @@ -486,11 +486,8 @@ class MapManager implements CallbackListener { $this->mapEnded = false; if (!isset($callback[1][0]["UId"])) { - // TODO: why can this even happen? - $this->maniaControl->errorHandler->triggerDebugNotice('map uid not set! ' . print_r($callback, true)); - return; - } - if (array_key_exists($callback[1][0]["UId"], $this->maps)) { + $this->currentMap = $this->fetchCurrentMap(); + } else if (array_key_exists($callback[1][0]["UId"], $this->maps)) { // Map already exists, only update index $this->currentMap = $this->maps[$callback[1][0]["UId"]]; if (!$this->currentMap->nbCheckpoints || !$this->currentMap->nbLaps) { @@ -516,7 +513,7 @@ class MapManager implements CallbackListener { * @param array $callback */ public function handleScriptBeginMap(array $callback) { - // ignored + $this->handleBeginMap(array()); } /**