Fix accepting draw via API when not able to send draw

pull/8750/head
Benedikt Werner 2021-04-24 23:27:21 +02:00
parent 52e7f7cf3c
commit b2647e1841
No known key found for this signature in database
GPG Key ID: 1DBFF0F8E9E121EB
1 changed files with 1 additions and 1 deletions

View File

@ -91,7 +91,7 @@ final class BotPlayer(
tellRound(pov.gameId, DrawNo(PlayerId(pov.playerId)))
def offerDraw(pov: Pov): Unit =
if (pov.game.drawable && pov.game.playerCanOfferDraw(pov.color))
if (pov.game.drawable && (pov.game.playerCanOfferDraw(pov.color) || pov.opponent.isOfferingDraw))
tellRound(pov.gameId, DrawYes(PlayerId(pov.playerId)))
def setDraw(pov: Pov, v: Boolean): Unit =