]> git.sesse.net Git - pgn-extract/commitdiff
Store the ECO before and not after the move.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 11 Dec 2014 00:35:03 +0000 (01:35 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 12 Dec 2014 21:56:56 +0000 (22:56 +0100)
apply.c

diff --git a/apply.c b/apply.c
index c58e16dc6af8ca3ac8216998ffbff523fcf999f9..b4379b961fe021c246508006b2cd5dcfa262864f 100644 (file)
--- a/apply.c
+++ b/apply.c
@@ -878,6 +878,7 @@ play_moves(Game *game_details, Board *board, Move *moves, unsigned max_depth,
                               board->hash_value,
                               game_details->cumulative_hash_value,
                               half_moves);
                               board->hash_value,
                               game_details->cumulative_hash_value,
                               half_moves);
+                      next_move->eco = eco_match;
                       if(entry != NULL){
                           /* Consider keeping the match.
                            * Could try to avoid spurious matches which become
                       if(entry != NULL){
                           /* Consider keeping the match.
                            * Could try to avoid spurious matches which become
@@ -903,7 +904,6 @@ play_moves(Game *game_details, Board *board, Move *moves, unsigned max_depth,
                               eco_match = entry;
                           }
                       }
                               eco_match = entry;
                           }
                       }
-                      next_move->eco = eco_match;
                   }
                   next_move = next_move->next;
                }
                   }
                   next_move = next_move->next;
                }