diff --git a/pyproject.toml b/pyproject.toml index ef5d89d..e98ce6a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "ttt" -version = "0.4.1" +version = "0.4.2" description = "Tic-Tac-Toe Telegram Bot" authors = [ {name = "Alexander Smolin", email = "88573504+emptybutton@users.noreply.github.com"} diff --git a/src/ttt/entities/core/matchmaking_queue/matchmaking_queue.py b/src/ttt/entities/core/matchmaking_queue/matchmaking_queue.py index bdcddc6..f928d52 100644 --- a/src/ttt/entities/core/matchmaking_queue/matchmaking_queue.py +++ b/src/ttt/entities/core/matchmaking_queue/matchmaking_queue.py @@ -79,9 +79,10 @@ def _is_game_allowed( user_waiting1: UserWaiting, user_waiting2: UserWaiting, ) -> bool: - return are_ranks_adjacent( - user_waiting1.user.rank(), user_waiting2.user.rank(), - ) + rank1 = user_waiting1.user.rank() + rank2 = user_waiting2.user.rank() + + return rank1 == rank2 or are_ranks_adjacent(rank1, rank2) MatchmakingQueueAtomic = MatchmakingQueue | UserWaiting