From 509856a3afcfb7410b13345b021071ce587b0401 Mon Sep 17 00:00:00 2001 From: ctx256 <85620376+ctx256@users.noreply.github.com> Date: Mon, 8 Aug 2022 15:05:29 +0300 Subject: [PATCH] Fix find-four exploit Prevent users from being able to take already occupied slots on row 5 --- houdini/handlers/games/four.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/houdini/handlers/games/four.py b/houdini/handlers/games/four.py index 07392e0..2d2d86f 100644 --- a/houdini/handlers/games/four.py +++ b/houdini/handlers/games/four.py @@ -13,7 +13,7 @@ class ConnectFourLogic(ITable): def is_valid_move(self, col, row): if 0 <= row <= 5 and 0 <= col <= 6: - if row == 5 or (self.board[col][row] == 0 and self.board[col][row + 1]): + if (row == 5 or self.board[col][row + 1]) and self.board[col][row] == 0: return True return False