From 65bd7679b1526bb810e512c608ab90fd1f77089a Mon Sep 17 00:00:00 2001 From: kremsy Date: Sun, 2 Mar 2014 10:27:55 +0100 Subject: [PATCH] statistic collector fix --- application/core/Statistics/StatisticCollector.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/application/core/Statistics/StatisticCollector.php b/application/core/Statistics/StatisticCollector.php index cd6f7182..8f276681 100644 --- a/application/core/Statistics/StatisticCollector.php +++ b/application/core/Statistics/StatisticCollector.php @@ -10,8 +10,8 @@ namespace ManiaControl\Statistics; use ManiaControl\Callbacks\CallbackListener; use ManiaControl\Callbacks\CallbackManager; use ManiaControl\ManiaControl; -use ManiaControl\Players\PlayerManager; use ManiaControl\Players\Player; +use ManiaControl\Players\PlayerManager; class StatisticCollector implements CallbackListener { /** @@ -71,7 +71,7 @@ class StatisticCollector implements CallbackListener { //Initialize Settings $this->maniaControl->settingManager->initSetting($this, self::SETTING_COLLECT_STATS_ENABLED, true); - $this->maniaControl->settingManager->initSetting($this, self::SETTING_COLLECT_STATS_MINPLAYERS, 2); //TODO just temp on 2 + $this->maniaControl->settingManager->initSetting($this, self::SETTING_COLLECT_STATS_MINPLAYERS, 4); $this->maniaControl->settingManager->initSetting($this, self::SETTING_ON_SHOOT_PRESTORE, 10); } @@ -271,7 +271,9 @@ class StatisticCollector implements CallbackListener { $this->maniaControl->statisticManager->incrementStat(self::STAT_ON_KILL, $shooter); } } - $this->maniaControl->statisticManager->incrementStat(self::STAT_ON_DEATH, $victim); + if ($victim) { + $this->maniaControl->statisticManager->incrementStat(self::STAT_ON_DEATH, $victim); + } break; case 'LibXmlRpc_OnPlayerRequestRespawn': $player = $this->maniaControl->playerManager->getPlayer($callback[1][1][0]);