mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 09:47:46 +00:00
Rewrite do_castle_move()
And handle the castle directly in do/undo_move(). This allow to greatly simplify the code. Here the beast is the nasty Chess960 that is really tricky to get it right because could be that 'from' and 'to' squares are the same or that king's 'to' square is rook's 'from' square. Anyhow should work: verified on all Chess960 starting positions. No functional and no speed change also in Chess960.
This commit is contained in:
+2
-2
@@ -191,8 +191,8 @@ private:
|
||||
void put_piece(Piece p, Square s);
|
||||
void set_castle_right(Color c, Square rfrom);
|
||||
|
||||
// Helper template functions
|
||||
template<bool Do> void do_castle_move(Move m);
|
||||
// Helper functions
|
||||
void do_castle(Square kfrom, Square kto, Square rfrom, Square rto);
|
||||
template<bool FindPinned> Bitboard hidden_checkers() const;
|
||||
|
||||
// Computing hash keys from scratch (for initialization and debugging)
|
||||
|
||||
Reference in New Issue
Block a user