Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
AttackingOrDefending authored Nov 4, 2023
1 parent 8cb384a commit 16673e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions matchmaking.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def update_user_profile(self) -> None:
pass

def get_weights(online_bots: list[USER_PROFILE_TYPE], rating_preference: str, min_rating: int, max_rating: int
) -> list[int]:
game_type: str) -> list[int]:
weights = [1] * len(online_bots)
if rating_preference == "high":
reduce_ratings_by = min(min_rating - (max_rating - min_rating), min_rating - 1)
Expand Down Expand Up @@ -210,7 +210,7 @@ def ready_for_challenge(bot: USER_PROFILE_TYPE) -> bool:
ready_bots = list(filter(ready_for_challenge, online_bots))
online_bots = ready_bots or online_bots
bot_username = None
weights = self.get_weights(online_bots, rating_preference, min_rating, max_rating)
weights = self.get_weights(online_bots, rating_preference, min_rating, max_rating, game_type)

try:
bot = random.choices(online_bots, weights=weights)[0]
Expand Down

0 comments on commit 16673e5

Please sign in to comment.