]> git.sesse.net Git - stockfish/commit
When generating checks add possibly under-promotions
authorMarco Costalba <mcostalba@gmail.com>
Mon, 21 Sep 2009 09:00:33 +0000 (10:00 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Tue, 22 Sep 2009 06:07:17 +0000 (07:07 +0100)
commitaed542d74cf57438fef19b662a56d8d810bc1965
treef7dc82844abafe964d02f26ccdaf1e0627aef82d
parentaaffcf973e9c23165ae1aec87c6a2ec1ef29634a
When generating checks add possibly under-promotions

In qsearch at depth 0 we generate only captures and checks.
Queen promotion moves are generated among the captures, but
under-promotion moves (both captures and non-captures) are
never generated even if they could give a discovery check.

This patch fixes this limitation extending generate_pawn_noncaptures()
to generate also check moves when required.

Apart for adding the (rare) case of an under-promotion that gives
discovery check, the patch is also a good cleanup because removes
generate_pawn_checks() altoghter.

This patch does the code clean-up but not enables the functional
change so to allow an easier debug.

No functional change and no performance change (actually a very
very small speed increase).

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/movegen.cpp