From 55729048876a63cbb6d264e074cbd754e4125080 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Mon, 15 Jul 2019 10:49:55 -0400 Subject: chessbox: Fixes and enhancements - Unfinished game is now saved along with current position. - All savings are automatically done on shutdown. - Implemented facility to view played games. - Fixed bug that prevented program from the very first move. Patch by Igor Poretsky Change-Id: I997b97752e4362ed953309bea985d071f9db229b --- apps/plugins/chessbox/chessbox_pgn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apps/plugins/chessbox/chessbox_pgn.c') diff --git a/apps/plugins/chessbox/chessbox_pgn.c b/apps/plugins/chessbox/chessbox_pgn.c index 39a24d6fa1..40e88e500b 100644 --- a/apps/plugins/chessbox/chessbox_pgn.c +++ b/apps/plugins/chessbox/chessbox_pgn.c @@ -22,9 +22,9 @@ #include "plugin.h" #include "chessbox_pgn.h" -#define PGN_FILE PLUGIN_GAMES_DATA_DIR "/chessbox.pgn" #define LOG_FILE PLUGIN_GAMES_DATA_DIR "/chessbox.log" int loghandler; +const char *pgn_file = PLUGIN_GAMES_DATA_DIR "/chessbox.pgn"; short kn_offs[8][2] = {{2,1},{2,-1},{-2,1},{-2,-1},{1,2},{1,-2},{-1,2},{-1,-2}}; short rk_offs[4][2] = {{1,0},{-1,0},{0,1},{0,-1}}; @@ -889,7 +889,7 @@ void pgn_store_game(struct pgn_game_node* game){ ply_count++; } - fhandler = rb->open(PGN_FILE, O_WRONLY|O_CREAT|O_APPEND, 0666); + fhandler = rb->open(pgn_file, O_WRONLY|O_CREAT|O_APPEND, 0666); /* the first 7 tags are mandatory according to the PGN specification so we -- cgit v1.2.3