]> git.sesse.net Git - pgn-extract/blobdiff - output.c
Store opening choices for each move.
[pgn-extract] / output.c
index 6e47275ca8842e32106a35d3b0117d95230c6975..297cf8b37b3e107e6922cf1256b296c51e390893 100644 (file)
--- a/output.c
+++ b/output.c
@@ -34,6 +34,7 @@
 #include "apply.h"
 #include "output.h"
 #include "mymalloc.h"
+#include "eco.h"
 
 
             /* Functions for outputting games in the required format. */
@@ -1205,7 +1206,7 @@ output_sesse_bin_game(Game current_game,FILE *outputfile,
     int black_elo = atoi(black_elo_tag);
 
     for (move = current_game.moves; move != NULL; move = move->next) {
-        unsigned int opening = 0;  // TODO
+        unsigned int opening = move->eco ? move->eco->cumulative_hash_value : 0;
 
         // key
         putc(move->bpfen_len + strlen((char *)move->move), outputfile);