From 5d7cc5990965b4e00f581e14fa9a5a8ac80ec281 Mon Sep 17 00:00:00 2001 From: Mini-Chiss Date: Wed, 5 Aug 2015 08:56:52 +0200 Subject: [PATCH] fixed cases where negative stats were being uploaded --- .../src/nautilus/game/arcade/managers/GameStatManager.java | 4 ++++ .../src/nautilus/game/arcade/stats/ExperienceStatTracker.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameStatManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameStatManager.java index cc1f81e1e..f855f9ffc 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameStatManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameStatManager.java @@ -68,6 +68,10 @@ public class GameStatManager implements Listener for (String stat : event.GetGame().GetStats().get(player).keySet()) { int value = event.GetGame().GetStats().get(player).get(stat); + + if (value <= 0) + continue; + Manager.GetStatsManager().incrementStat(player, stat, value); // Leaderboard hook for logging appropriate stat events diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/ExperienceStatTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/ExperienceStatTracker.java index 17677ad64..1ecd74283 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/ExperienceStatTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/ExperienceStatTracker.java @@ -42,7 +42,7 @@ public class ExperienceStatTracker extends StatTracker if (!event.GetGame().Manager.IsRewardStats() || !event.GetGame().Manager.IsRewardAchievements()) return; - if (_startTime == -1) + if (_startTime <= 0) return; if (event.GetState() == Game.GameState.End)