From 1f589e9e93b680483ef2fdabe508f4ba357f8671 Mon Sep 17 00:00:00 2001 From: kremsy Date: Sat, 1 Mar 2014 12:58:08 +0100 Subject: [PATCH] small fix --- application/core/ManiaExchange/ManiaExchangeManager.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/application/core/ManiaExchange/ManiaExchangeManager.php b/application/core/ManiaExchange/ManiaExchangeManager.php index 431ce167..b202b2ed 100644 --- a/application/core/ManiaExchange/ManiaExchangeManager.php +++ b/application/core/ManiaExchange/ManiaExchangeManager.php @@ -274,8 +274,10 @@ class ManiaExchangeManager { // compile search URL $url = 'http://' . $titlePrefix . '.mania-exchange.com/tracksearch?api=on'; - if ($env != '') { - $url .= '&environments=' . $this->getEnvironment($env); + $game = explode('@', $titleId); + $envNumber = $this->getEnvironment($game[0]); + if($env != '' || $envNumber != -1){ + $url .= '&environments=' . $envNumber; } if ($name != '') { $url .= '&trackname=' . str_replace(" ", "%20", $name); @@ -287,6 +289,7 @@ class ManiaExchangeManager { $url .= '&priord=' . $searchOrder; $url .= '&limit=' . $maxMapsReturned; + // Get MapTypes try { $scriptInfos = $this->maniaControl->client->getModeScriptInfo(); @@ -334,7 +337,6 @@ class ManiaExchangeManager { private function getEnvironment($env) { switch($env) { case 'TMCanyon': - case 'SMStorm': return 1; case 'TMStadium': return 2;