From 1fc4ad999feb9adb42066793649cc1126468874e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Mon, 23 Jun 2014 16:17:39 +0200 Subject: [PATCH] catch next map exception --- application/core/Maps/MapList.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/application/core/Maps/MapList.php b/application/core/Maps/MapList.php index 8129f5c7..bb733ad6 100644 --- a/application/core/Maps/MapList.php +++ b/application/core/Maps/MapList.php @@ -2,7 +2,6 @@ namespace ManiaControl\Maps; -use FML\Controls\Control; use FML\Controls\Frame; use FML\Controls\Gauge; use FML\Controls\Label; @@ -626,7 +625,6 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener { $votesPlugin->startVote($player, 'switchmap', function ($result) use (&$votesPlugin, &$map) { // TODO: $result isn't used -> bug? does it skip even if vote is not successful? - $this->maniaControl->chat->sendInformation('$sVote Successful -> Map switched!'); $votesPlugin->undefineVote('switchmap'); //Don't queue on Map-Change @@ -634,8 +632,13 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener { try { $this->maniaControl->client->JumpToMapIdent($map->uid); + } catch (NextMapException $e) { + return; } catch (NotInListException $e) { + return; } + + $this->maniaControl->chat->sendInformation('$sVote Successful -> Map switched!'); }); break; case self::ACTION_QUEUED_MAP: