Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Fix /until crashing if the max rank has already been reached #159

Merged
merged 1 commit into from
Jan 4, 2022

Conversation

TimJentzsch
Copy link
Contributor

@TimJentzsch TimJentzsch commented Jan 4, 2022

Relevant issue: Closes #156

Description:

By default, the /until command takes the next rank as goal.
However, if the maximum rank has already been reached, it would throw an error.
Now, it will fall back to the next 10,000 tier.

Screenshots:

The /until command executed for u/Cloakknight. It now takes 30,000 gamma as default for the next goal.

Checklist:

  • Code Quality
  • Pep-8
  • Tests (if applicable)
  • Success Criteria Met
  • Inline Documentation
  • Wiki Documentation (if applicable)

By default, the /until command takes the next rank as goal.
However, if the maximum rank has already been reached, it would throw an error.
Now, it will fall back to the next 10,000 tier.
@TimJentzsch TimJentzsch requested a review from a team as a code owner January 4, 2022 18:31
goal_gamma, goal_str = parse_goal_str(next_rank["name"])
else:
# If the user has reached the maximum rank, take the next 10,000 tier
goal_gamma = ((user["gamma"] + 10_000) // 10_000) * 10_000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought "surely there's a better way to do this" and then I looked it up, and there is not a better way to do this. Works for me!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It definitely felt stupid to write, but I couldn't think of a better way

@TimJentzsch TimJentzsch merged commit adeb5af into master Jan 4, 2022
@TimJentzsch TimJentzsch deleted the fix-next-rank branch January 4, 2022 18:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix next rank determination for maximum rank
2 participants