summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--PLAN4
-rw-r--r--chess-game.el5
-rw-r--r--chess-ply.el6
3 files changed, 9 insertions, 6 deletions
diff --git a/PLAN b/PLAN
index 988cfe2..78333ae 100644
--- a/PLAN
+++ b/PLAN
@@ -51,6 +51,10 @@ chess-irc
chess-ply
- detect games drawn by three-fold repetition
+chess-pos
+- if I checkmate someone, the last position does not have its status
+ set to :checkmate
+
chess-german
- complete translation
diff --git a/chess-game.el b/chess-game.el
index 231cc03..c66d04b 100644
--- a/chess-game.el
+++ b/chess-game.el
@@ -179,10 +179,7 @@ matches."
This conveys the status of the game at the given index."
(assert game)
(or (chess-pos-status (chess-game-pos game index))
- (let ((final (chess-ply-final-p (chess-game-ply game index))))
- (and (memq final '(:aborted :resign :drawn :perpetual :repetition
- :flag-fell))
- final))))
+ (chess-ply-final-p (chess-game-ply game index))))
(defsubst chess-game-index (game)
"Return the GAME's current position index."
diff --git a/chess-ply.el b/chess-ply.el
index 321da83..4ef3558 100644
--- a/chess-ply.el
+++ b/chess-ply.el
@@ -259,8 +259,10 @@ maneuver."
(defsubst chess-ply-final-p (ply)
"Return non-nil if this is the last ply of a game/variation."
- (chess-ply-any-keyword ply :drawn :perpetual :repetition :stalemate
- :flag-fell :resign :checkmate :aborted))
+ (or (chess-ply-any-keyword ply :drawn :perpetual :repetition
+ :flag-fell :resign :aborted)
+ (chess-ply-any-keyword (chess-pos-preceding-ply
+ (chess-ply-pos ply)) :stalemate :checkmate)))
(eval-when-compile
(defvar position)