Update DynamicPointlimitPlugin.php

Added error check if player array was empty ..
This commit is contained in:
Designburo 2014-05-17 22:40:37 +02:00
parent 2e04725479
commit 6d0ad1d6bd

View File

@ -164,19 +164,20 @@ class DynamicPointlimitPlugin implements CallbackListener, CommandListener, Plug
$this->changePointlimit(); $this->changePointlimit();
} }
// on player info changed, this checks to see if it is about the spectator status
public function checkStatus(array $callback) { public function checkStatus(array $callback) {
$specStatus = (int)$callback[1][0]['SpectatorStatus']; if(!$this->mode) return;
$specStatus = $callback[1][0]["SpectatorStatus"];
$login = $callback[1][0]['Login']; $login = $callback[1][0]['Login'];
//$this->maniaControl->chat->sendChat('$<$fffSpectatus of '.$login.'is '.$specStatus.' $> '.$pointlimit);
$player = $this->maniaControl->playerManager->getPlayer($login); $player = $this->maniaControl->playerManager->getPlayer($login);
if(isset($this->specStatus))
{
if($this->specStatus[$login] != $specStatus) if($this->specStatus[$login] != $specStatus)
{ {
$this->changePointlimit(); $this->changePointlimit();
} }
} }
}
/** /**
* Function called on player connect and disconnect, changing the pointlimit. * Function called on player connect and disconnect, changing the pointlimit.
* *