diff --git a/application/core/ManiaExchange/ManiaExchangeList.php b/application/core/ManiaExchange/ManiaExchangeList.php index 83477bc4..e067d32a 100644 --- a/application/core/ManiaExchange/ManiaExchangeList.php +++ b/application/core/ManiaExchange/ManiaExchangeList.php @@ -98,14 +98,16 @@ class ManiaExchangeList implements CallbackListener, ManialinkPageAnswerListener } } - // search for matching maps - $this->maniaControl->mapManager->mxManager->getMapsAssync(function ($maps) use (&$player) { + $function = function ($maps) use (&$player) { if ($maps == null) { $this->maniaControl->chat->sendError('No maps found, or MX is down!', $player->login); return; } $this->showManiaExchangeList($maps, $player); - }, $searchString, $author, $environment); + }; + + // search for matching maps + $this->maniaControl->mapManager->mxManager->getMapsAssync($function, $searchString, $author, $environment); } /**