Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing changes of default score #1400

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/src/main/java/tc/oc/pgm/rotation/pools/VotingPool.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ public double getMapScore(MapInfo map) {
private void tickScores(Match match) {
// If the current map isn't from this pool, ignore ticking
if (!mapScores.containsKey(match.getMap())) return;
mapScores.replaceAll((mapScores, value) -> value > DEFAULT_SCORE
? Math.max(value - constants.scoreDecay(), DEFAULT_SCORE)
: Math.min(value + constants.scoreRise(), DEFAULT_SCORE));
mapScores.replaceAll((mapScores, value) -> value > constants.defaultScore()
? Math.max(value - constants.scoreDecay(), constants.defaultScore())
: Math.min(value + constants.scoreRise(), constants.defaultScore()));
mapScores.put(
match.getMap(), constants.scoreAfterPlay().applyAsDouble(new Context(match.getDuration())));
}
Expand Down