Skip to content

Commit

Permalink
bugfix: fixed for old periods to not reduce points and scored on stale (
Browse files Browse the repository at this point in the history
  • Loading branch information
akorchyn authored Nov 12, 2024
1 parent 98bad8d commit 60ca9c1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions shared/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,10 @@ impl VersionedUserPeriodData {

pub fn remove_reward_for_scoring(&mut self) {
let mut data: UserPeriodDataV2 = self.clone().into();
data.prs_scored -= 1;
data.total_rating -= 25;
if data.prs_scored > 0 {
data.prs_scored -= 1;
data.total_rating -= 25;
}
*self = Self::V2(data);
}

Expand Down

0 comments on commit 60ca9c1

Please sign in to comment.