Actually commit stuff from ages ago
[progcomp2013.git] / qchess / src / piece.py
index 81fbb56..162e82e 100644 (file)
@@ -19,7 +19,7 @@ class Piece():
                
                self.move_pattern = None
                self.coverage = None
-
+               self.possible_moves = None
                
 
        def init_from_copy(self, c):
@@ -75,7 +75,7 @@ class Piece():
        
        # Collapses the wave function!          
        def select(self):
-               if self.current_type == "unknown":
+               if self.current_type == "unknown" or not self.choice in [0,1]:
                        self.choice = random.randint(0,1)
                        if self.types[self.choice][0] == '?':
                                self.types[self.choice] = self.types[self.choice][1:]

UCC git Repository :: git.ucc.asn.au