forked from Ad5001/PlayerSelectors
Fixing misused brezk statements
This commit is contained in:
parent
e3ea4cfeb5
commit
0cb3975928
4 changed files with 11 additions and 11 deletions
|
@ -34,9 +34,9 @@ class AllPlayers extends Selector{
|
||||||
$params = $parameters + $defaultParams;
|
$params = $parameters + $defaultParams;
|
||||||
$return = [];
|
$return = [];
|
||||||
foreach(Server::getInstance()->getOnlinePlayers() as $p){
|
foreach(Server::getInstance()->getOnlinePlayers() as $p){
|
||||||
if($params["c"] !== 0 && count($return) == $params["c"]) break; // Too much players
|
if($params["c"] !== 0 && count($return) == $params["c"]) continue; // Too much players
|
||||||
if($p->getLevel()->getName() !== $params["lvl"] && $params["lvl"] !== "") break; // Not in the right level
|
if($p->getLevel()->getName() !== $params["lvl"] && $params["lvl"] !== "") continue; // Not in the right level
|
||||||
if(!$this->checkDefaultParams($p, $params)) break;
|
if(!$this->checkDefaultParams($p, $params)) continue;
|
||||||
$return[] = $p->getName();
|
$return[] = $p->getName();
|
||||||
}
|
}
|
||||||
return $return;
|
return $return;
|
||||||
|
|
|
@ -37,9 +37,9 @@ class Entities extends Selector{
|
||||||
$return = [];
|
$return = [];
|
||||||
foreach(Server::getInstance()->getLevels() as $lvl){
|
foreach(Server::getInstance()->getLevels() as $lvl){
|
||||||
foreach($lvl->getEntities() as $e){
|
foreach($lvl->getEntities() as $e){
|
||||||
if($params["c"] !== 0 && count($return) == $params["c"]) break; // Too much players
|
if($params["c"] !== 0 && count($return) == $params["c"]) continue; // Too much players
|
||||||
if($e->getLevel()->getName() !== $params["lvl"] && $params["lvl"] !== "") break; // Not in the right level
|
if($e->getLevel()->getName() !== $params["lvl"] && $params["lvl"] !== "") continue; // Not in the right level
|
||||||
if(!$this->checkDefaultParams($e, $params)) break;
|
if(!$this->checkDefaultParams($e, $params)) continue;
|
||||||
$return[] = "e" . $e->getId();
|
$return[] = "e" . $e->getId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,8 @@ class RandomPlayer extends Selector{
|
||||||
$params = $parameters + $defaultParams;
|
$params = $parameters + $defaultParams;
|
||||||
$possible = [];
|
$possible = [];
|
||||||
foreach(Server::getInstance()->getOnlinePlayers() as $p){
|
foreach(Server::getInstance()->getOnlinePlayers() as $p){
|
||||||
if($p->getLevel()->getName() !== $params["lvl"] && $params["lvl"] !== "") break; // Not in the right level
|
if($p->getLevel()->getName() !== $params["lvl"] && $params["lvl"] !== "") continue; // Not in the right level
|
||||||
if(!$this->checkDefaultParams($p, $params)) break;
|
if(!$this->checkDefaultParams($p, $params)) continue;
|
||||||
$possible[] = $p;
|
$possible[] = $p;
|
||||||
}
|
}
|
||||||
if(count($possible) == 0) return [];
|
if(count($possible) == 0) return [];
|
||||||
|
|
|
@ -38,9 +38,9 @@ class WorldPlayers extends Selector{
|
||||||
$params = $parameters + $defaultParams;
|
$params = $parameters + $defaultParams;
|
||||||
$return = [];
|
$return = [];
|
||||||
foreach(Server::getInstance()->getOnlinePlayers() as $p){
|
foreach(Server::getInstance()->getOnlinePlayers() as $p){
|
||||||
if($params["c"] !== 0 && count($return) == $params["c"]) break; // Too much players
|
if($params["c"] !== 0 && count($return) == $params["c"]) continue; // Too much players
|
||||||
if($p->getLevel()->getName() !== $params["lvl"] && $params["lvl"] !== "") break; // Not in the right level
|
if($p->getLevel()->getName() !== $params["lvl"] && $params["lvl"] !== "") continue; // Not in the right level
|
||||||
if(!$this->checkDefaultParams($p, $params)) break;
|
if(!$this->checkDefaultParams($p, $params)) continue;
|
||||||
$return[] = $p->getName();
|
$return[] = $p->getName();
|
||||||
}
|
}
|
||||||
return $return;
|
return $return;
|
||||||
|
|
Loading…
Reference in a new issue