Browse Source

Fixing misused brezk statements

pull/5/merge
Ad5001 2 years ago
parent
commit
0cb3975928

+ 3
- 3
src/Ad5001/PlayerSelectors/selector/AllPlayers.php 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;

+ 3
- 3
src/Ad5001/PlayerSelectors/selector/Entities.php 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();
}
}

+ 2
- 2
src/Ad5001/PlayerSelectors/selector/RandomPlayer.php 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 [];

+ 3
- 3
src/Ad5001/PlayerSelectors/selector/WorldPlayers.php 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;

Loading…
Cancel
Save