1
0
Fork 0
mirror of synced 2024-05-29 16:59:42 +12:00

Added a error check in case someone tries to play in an already used place

This commit is contained in:
Phxntxm 2016-08-14 16:04:37 -05:00
parent 0ffd198da6
commit b7fcad1c61

View file

@ -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']