Fixing misused brezk statements

This commit is contained in:
Adsooi 2017-11-05 16:31:11 +01:00
parent e3ea4cfeb5
commit 0cb3975928
4 changed files with 11 additions and 11 deletions

View file

@ -34,9 +34,9 @@ class AllPlayers extends Selector{
$params = $parameters + $defaultParams;
$return = [];
foreach(Server::getInstance()->getOnlinePlayers() as $p){
if($params["c"] !== 0 && count($return) == $params["c"]) break; // Too much players
if($p->getLevel()->getName() !== $params["lvl"] && $params["lvl"] !== "") break; // Not in the right level
if(!$this->checkDefaultParams($p, $params)) break;
if($params["c"] !== 0 && count($return) == $params["c"]) continue; // Too much players
if($p->getLevel()->getName() !== $params["lvl"] && $params["lvl"] !== "") continue; // Not in the right level
if(!$this->checkDefaultParams($p, $params)) continue;
$return[] = $p->getName();
}
return $return;

View file

@ -37,9 +37,9 @@ class Entities extends Selector{
$return = [];
foreach(Server::getInstance()->getLevels() as $lvl){
foreach($lvl->getEntities() as $e){
if($params["c"] !== 0 && count($return) == $params["c"]) break; // Too much players
if($e->getLevel()->getName() !== $params["lvl"] && $params["lvl"] !== "") break; // Not in the right level
if(!$this->checkDefaultParams($e, $params)) break;
if($params["c"] !== 0 && count($return) == $params["c"]) continue; // Too much players
if($e->getLevel()->getName() !== $params["lvl"] && $params["lvl"] !== "") continue; // Not in the right level
if(!$this->checkDefaultParams($e, $params)) continue;
$return[] = "e" . $e->getId();
}
}

View file

@ -34,8 +34,8 @@ class RandomPlayer extends Selector{
$params = $parameters + $defaultParams;
$possible = [];
foreach(Server::getInstance()->getOnlinePlayers() as $p){
if($p->getLevel()->getName() !== $params["lvl"] && $params["lvl"] !== "") break; // Not in the right level
if(!$this->checkDefaultParams($p, $params)) break;
if($p->getLevel()->getName() !== $params["lvl"] && $params["lvl"] !== "") continue; // Not in the right level
if(!$this->checkDefaultParams($p, $params)) continue;
$possible[] = $p;
}
if(count($possible) == 0) return [];

View file

@ -38,9 +38,9 @@ class WorldPlayers extends Selector{
$params = $parameters + $defaultParams;
$return = [];
foreach(Server::getInstance()->getOnlinePlayers() as $p){
if($params["c"] !== 0 && count($return) == $params["c"]) break; // Too much players
if($p->getLevel()->getName() !== $params["lvl"] && $params["lvl"] !== "") break; // Not in the right level
if(!$this->checkDefaultParams($p, $params)) break;
if($params["c"] !== 0 && count($return) == $params["c"]) continue; // Too much players
if($p->getLevel()->getName() !== $params["lvl"] && $params["lvl"] !== "") continue; // Not in the right level
if(!$this->checkDefaultParams($p, $params)) continue;
$return[] = $p->getName();
}
return $return;