Skip to content

Commit

Permalink
Don't let players' RD drift beyond the maximum
Browse files Browse the repository at this point in the history
  • Loading branch information
pyuk-bot authored Dec 19, 2024
1 parent 636a23a commit 1e6f6a6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ladder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,10 @@ export class GlickoPlayer {
// Follow along the steps using: http://www.glicko.net/glicko/glicko.pdf

if (m.length === 0) {
const RD = Math.sqrt((this.rd * this.rd) + (this.c * this.c));
let RD = Math.sqrt((this.rd * this.rd) + (this.c * this.c));
if (RD > this.RDmax) {
RD = this.RDmax;
}
return {R: this.rating, RD};
}

Expand Down

0 comments on commit 1e6f6a6

Please sign in to comment.