This commit is contained in:
Shoghi Cervantes 2014-02-14 20:53:15 +01:00
parent 2b15c440ee
commit dfe7269019

View File

@ -196,9 +196,6 @@ class PlayerAPI{
"spectator" => VIEW, "spectator" => VIEW,
"v" => VIEW, "v" => VIEW,
); );
if($issuer instanceof Player){
$player = $issuer;
}
if(isset($params[1])){ if(isset($params[1])){
if($this->server->api->player->get($params[1]) instanceof Player){ if($this->server->api->player->get($params[1]) instanceof Player){
$player = $this->server->api->player->get($params[1]); $player = $this->server->api->player->get($params[1]);
@ -210,7 +207,15 @@ class PlayerAPI{
$output .= "Usage: /$cmd <mode> [player] or /$cmd [player] <mode>\n"; $output .= "Usage: /$cmd <mode> [player] or /$cmd [player] <mode>\n";
break; break;
} }
}elseif(isset($params[0])){
if(!($this->server->api->player->get($params[0]) instanceof Player)){
if($issuer instanceof Player){
$setgm = $params[0];
$player = $issuer;
} }
}
}
if(!($player instanceof Player) or !isset($gms[strtolower($setgm)])){ if(!($player instanceof Player) or !isset($gms[strtolower($setgm)])){
$output .= "Usage: /$cmd <mode> [player] or /$cmd [player] <mode>\n"; $output .= "Usage: /$cmd <mode> [player] or /$cmd [player] <mode>\n";
break; break;