php 5.3 compatiblity

This commit is contained in:
kremsy
2014-04-20 14:52:26 +02:00
committed by Steffen Schröder
parent ea9c929ec3
commit 7408ffb4ac
11 changed files with 165 additions and 148 deletions

View File

@ -103,17 +103,15 @@ class ManiaExchangeList implements CallbackListener, ManialinkPageAnswerListener
}
}
$function = function ($maps) use (&$player) {
// search for matching maps
$self = $this;
$this->maniaControl->mapManager->mxManager->getMapsAsync(function ($maps) use (&$self, &$player) {
if (!$maps) {
$this->maniaControl->chat->sendError('No maps found, or MX is down!', $player->login);
$self->maniaControl->chat->sendError('No maps found, or MX is down!', $player->login);
return;
}
$this->showManiaExchangeList($maps, $player);
};
// search for matching maps
$this->maniaControl->mapManager->mxManager->getMapsAsync($function, $searchString, $author, $environment);
$self->showManiaExchangeList($maps, $player);
}, $searchString, $author, $environment);
}
/**