projects
/
fairystockfish.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
5b7a141
)
Correctly handle castle in see()
author
Marco Costalba
<mcostalba@gmail.com>
Fri, 20 May 2011 05:57:20 +0000 (06:57 +0100)
committer
Marco Costalba
<mcostalba@gmail.com>
Fri, 20 May 2011 05:58:53 +0000 (06:58 +0100)
Suggested by Onno.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/position.cpp
patch
|
blob
|
history
diff --git
a/src/position.cpp
b/src/position.cpp
index
59c3a8c
..
b254d60
100644
(file)
--- a/
src/position.cpp
+++ b/
src/position.cpp
@@
-1513,6
+1513,12
@@
int Position::see(Move m) const {
assert(move_is_ok(m));
+ // As castle moves are implemented as capturing the rook, they have
+ // SEE == RookValueMidgame most of the times (unless the rook is under
+ // attack).
+ if (move_is_castle(m))
+ return 0;
+
from = move_from(m);
to = move_to(m);
capturedType = type_of_piece_on(to);