Added a error check in case someone tries to play in an already used place
This commit is contained in:
parent
0ffd198da6
commit
b7fcad1c61
|
@ -181,7 +181,9 @@ class TicTacToe:
|
|||
|
||||
|
||||
# If all checks have been made, x and y should now be defined correctly based on the matches, and we can go ahead and:
|
||||
board.update(x, y)
|
||||
if not board.update(x, y):
|
||||
await self.bot.say("Someone has already played there!")
|
||||
return
|
||||
winner = board.check()
|
||||
if winner:
|
||||
loser = board.challengers['x'] if board.challengers['x'] != winner else board.challengers['o']
|
||||
|
|
Loading…
Reference in a new issue