Skip to content

Commit

Permalink
Prefer is_attacked_by where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasf committed Mar 6, 2017
1 parent 5a9a4b7 commit 145d49a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chess/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3245,7 +3245,7 @@ def generate_legal_captures(self, from_mask=BB_ALL, to_mask=BB_ALL):
self.generate_legal_ep(from_mask, to_mask))

def _attacked_for_king(self, path):
return any(self.attackers_mask(not self.turn, sq) for sq in scan_reversed(path))
return any(self.is_attacked_by(not self.turn, sq) for sq in scan_reversed(path))

def generate_castling_moves(self, from_mask=BB_ALL, to_mask=BB_ALL):
if self.is_variant_end():
Expand Down

0 comments on commit 145d49a

Please sign in to comment.