removed weird != null comparing
(why are you doing this??)
This commit is contained in:
@ -90,7 +90,7 @@ class Map {
|
||||
*/
|
||||
public function updateAvailable() {
|
||||
|
||||
if ($this->mx != null && ($this->lastUpdate < strtotime($this->mx->updated) || $this->uid != $this->mx->uid)) {
|
||||
if ($this->mx && ($this->lastUpdate < strtotime($this->mx->updated) || $this->uid != $this->mx->uid)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
@ -98,7 +98,7 @@ class MapCommands implements CommandListener, ManialinkPageAnswerListener, Callb
|
||||
*/
|
||||
public function command_ShowNextMap(array $chat, Player $player) {
|
||||
$nextQueued = $this->maniaControl->mapManager->mapQueue->getNextQueuedMap();
|
||||
if ($nextQueued != null) {
|
||||
if ($nextQueued) {
|
||||
/** @var Player $requester */
|
||||
$requester = $nextQueued[0];
|
||||
/** @var Map $map */
|
||||
|
@ -566,7 +566,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
|
||||
foreach($this->mapListShown as $login => $shown) {
|
||||
if ($shown) {
|
||||
$player = $this->maniaControl->playerManager->getPlayer($login);
|
||||
if ($player != null) {
|
||||
if ($player) {
|
||||
$this->showMapList($player);
|
||||
} else {
|
||||
unset($this->mapListShown[$login]);
|
||||
|
@ -325,7 +325,7 @@ class MapManager implements CallbackListener {
|
||||
|
||||
$this->fetchCurrentMap();
|
||||
|
||||
if ($admin != null) {
|
||||
if ($admin) {
|
||||
$message = '$<' . $admin->nickname . '$> shuffled the Maplist!';
|
||||
$this->maniaControl->chat->sendSuccess($message);
|
||||
$this->maniaControl->log($message, true);
|
||||
@ -619,7 +619,7 @@ class MapManager implements CallbackListener {
|
||||
*/
|
||||
private function processMapFile($file, MXMapInfo $mapInfo, $login, $update) {
|
||||
// Check if map is already on the server
|
||||
if ($this->getMapByUid($mapInfo->uid) != null) {
|
||||
if ($this->getMapByUid($mapInfo->uid)) {
|
||||
// Download error
|
||||
$this->maniaControl->chat->sendError('Map is already on the server!', $login);
|
||||
return;
|
||||
|
@ -151,7 +151,7 @@ class MapQueue implements CallbackListener, CommandListener {
|
||||
$player = $queuedMap[0];
|
||||
|
||||
//found player, so play this map
|
||||
if ($this->maniaControl->playerManager->getPlayer($player->login) != null) {
|
||||
if ($this->maniaControl->playerManager->getPlayer($player->login)) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user