From dc495e0ca970bff7dbde94bee818a0e8e5ec0844 Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Tue, 21 Nov 2017 11:07:48 +0200 Subject: [PATCH] Added maximum to playtime dependency of activityIndex --- .../java/com/djrapitops/plan/data/PlayerProfile.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Plan/src/main/java/com/djrapitops/plan/data/PlayerProfile.java b/Plan/src/main/java/com/djrapitops/plan/data/PlayerProfile.java index 4320f271f..dbbde19ec 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/PlayerProfile.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/PlayerProfile.java @@ -97,9 +97,21 @@ public class PlayerProfile implements OfflinePlayer { List sessionsWeek2 = getSessions(twoWeeksAgo, weekAgo).collect(Collectors.toList()); List sessionsWeek3 = getSessions(threeWeeksAgo, twoWeeksAgo).collect(Collectors.toList()); + // Playtime per week multipliers, max out to avoid too high values. + double max = 4.0; + double weekPlay = (PlayerProfile.getPlaytime(sessionsWeek.stream()) * 1.0 / activePlayThreshold); + if (weekPlay > max) { + weekPlay = max; + } double week2Play = (PlayerProfile.getPlaytime(sessionsWeek2.stream()) * 1.0 / activePlayThreshold); + if (week2Play > max) { + week2Play = max; + } double week3Play = (PlayerProfile.getPlaytime(sessionsWeek3.stream()) * 1.0 / activePlayThreshold); + if (week3Play > max) { + week3Play = max; + } // Reduce the harshness for new players and players who have had a vacation if (weekPlay > 1 && week3Play > 1 && week2Play == 0.0) {