LordDarkula / chess_py

Chess library for simple chess engine creation
http://lorddarkula.github.io/chess_py/
MIT License
12 stars 5 forks source link

Fix castling exception #8

Open LordDarkula opened 8 years ago

LordDarkula commented 8 years ago

When castling, the Location of the King somehow ends up as empty when testing checks in King.

test = copy.deepcopy(position)
# Somehow the Location of the King is empty 

test_move = Move(end_loc=move.end_loc,
                 piece=test.piece_at_square(self.location), # Problem right here
                 status=move.status,
                 start_rank=self.location.rank,
                 start_file=self.location.file)

test.update(test_move)
test_king = test.piece_at_square(test_move.end_loc)
LordDarkula commented 8 years ago

Most probably caused by Queen side castling