fixed getPlayer

This commit is contained in:
Steffen Schröder 2014-05-15 19:30:44 +02:00
parent 0ca8793a58
commit f7070a51e1

View File

@ -357,11 +357,14 @@ class PlayerManager implements CallbackListener, TimerListener {
/** /**
* Get a Player by Login * Get a Player by Login
* *
* @param string $login * @param mixed $login
* @param bool $connectedPlayersOnly * @param bool $connectedPlayersOnly
* @return Player * @return Player
*/ */
public function getPlayer($login, $connectedPlayersOnly = false) { public function getPlayer($login, $connectedPlayersOnly = false) {
if ($login instanceof Player) {
return $login;
}
if (!isset($this->players[$login])) { if (!isset($this->players[$login])) {
if ($connectedPlayersOnly) { if ($connectedPlayersOnly) {
return null; return null;