small fix

This commit is contained in:
kremsy 2014-02-15 16:42:18 +01:00 committed by Steffen Schröder
parent 3773882cee
commit 8bce1ea949

View File

@ -271,8 +271,10 @@ class StatisticCollector implements CallbackListener {
$victim = $this->maniaControl->playerManager->getPlayer($callback[1][1][1]); $victim = $this->maniaControl->playerManager->getPlayer($callback[1][1][1]);
if (isset($callback[1][1][0])) { if (isset($callback[1][1][0])) {
$shooter = $this->maniaControl->playerManager->getPlayer($callback[1][1][0]); $shooter = $this->maniaControl->playerManager->getPlayer($callback[1][1][0]);
if ($shooter != null) {
$this->maniaControl->statisticManager->incrementStat(self::STAT_ON_KILL, $shooter); $this->maniaControl->statisticManager->incrementStat(self::STAT_ON_KILL, $shooter);
} }
}
$this->maniaControl->statisticManager->incrementStat(self::STAT_ON_DEATH, $victim); $this->maniaControl->statisticManager->incrementStat(self::STAT_ON_DEATH, $victim);
break; break;
case 'LibXmlRpc_OnPlayerRequestRespawn': case 'LibXmlRpc_OnPlayerRequestRespawn':
@ -308,6 +310,9 @@ class StatisticCollector implements CallbackListener {
$this->maniaControl->statisticManager->incrementStat(self::STAT_ON_DEATH, $victim); $this->maniaControl->statisticManager->incrementStat(self::STAT_ON_DEATH, $victim);
if (isset($paramsObject->Event->Shooter->Login)) { if (isset($paramsObject->Event->Shooter->Login)) {
$shooter = $this->maniaControl->playerManager->getPlayer($paramsObject->Event->Shooter->Login); $shooter = $this->maniaControl->playerManager->getPlayer($paramsObject->Event->Shooter->Login);
if ($shooter != null) {
$this->maniaControl->statisticManager->incrementStat(self::STAT_ON_KILL, $shooter);
}
$this->maniaControl->statisticManager->incrementStat(self::STAT_ON_KILL, $shooter); $this->maniaControl->statisticManager->incrementStat(self::STAT_ON_KILL, $shooter);
} }
break; break;