From a3cc3acb713e16a644c5bd60d8491f99c4b2a7c1 Mon Sep 17 00:00:00 2001 From: Andrés Ambrois Date: Fri, 29 Aug 2008 03:07:11 +0000 Subject: Fixed passing with AI --- (limited to 'activity.py') diff --git a/activity.py b/activity.py index 21dc578..99d70a1 100644 --- a/activity.py +++ b/activity.py @@ -155,16 +155,17 @@ class PlayGo(Activity): self.board.draw_stone(x, y, self.get_currentcolor(), widget) # Player passed else: - self.infopanel.show(_('Opponent passed')) self.pass_count += 1 # Announce the local play if self.get_shared() and announce: self.collaboration.Play(x, y) + self.change_turn() + if x == -1: + self.infopanel.show(_('Opponent passed')) # If this is the second consecutive pass, the game ends if self.pass_count == 2: self.game_end() return - self.change_turn() # If we are playing a local game with AI turned off, change the color if not self.get_shared() and not self.ai_activated: self.change_player_color() @@ -202,6 +203,9 @@ class PlayGo(Activity): self.change_turn() if self.pass_count == 2: self.game_end() + if self.ai_activated: + self.ai.pass_move(self.get_currentcolor()) + self.play_ai() def write_file(self, file_path): logger.debug('Writing file: %s', file_path) -- cgit v0.9.1