summaryrefslogtreecommitdiff
path: root/chess-algebraic.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-05-01 00:07:17 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-05-01 00:07:17 +0000
commitfde9ea1637b3cb0e26f0217a691b4a5536f14345 (patch)
treeec8c7790261499f5feea74bf0fa27664a1887e4e /chess-algebraic.el
parentf6fcd3b9a85bde4a985094cd48235975a0ba1be5 (diff)
Tiny code rearrangement. If chess-ply-castling-changes fails, no ply
create will be attempted.
Diffstat (limited to 'chess-algebraic.el')
-rw-r--r--chess-algebraic.el14
1 files changed, 7 insertions, 7 deletions
diff --git a/chess-algebraic.el b/chess-algebraic.el
index 848a97c..071e414 100644
--- a/chess-algebraic.el
+++ b/chess-algebraic.el
@@ -66,7 +66,7 @@ This regexp handles both long and short form.")
(let ((color (chess-pos-side-to-move position))
(mate (match-string 9 move))
(piece (aref move 0))
- changes ply)
+ changes)
(if (eq piece ?O)
(setq changes (chess-ply-castling-changes
position (= (length (match-string 1 move)) 5)))
@@ -110,13 +110,13 @@ This regexp handles both long and short form.")
(if promotion
(nconc changes (list :promote (aref promotion 0))))))
- (when trust
- (if mate
- (nconc changes (list (if (equal mate "#") :checkmate :check))))
- (nconc changes (list :san move)))
+ (when changes
+ (when trust
+ (if mate
+ (nconc changes (list (if (equal mate "#") :checkmate :check)))))
+ (nconc changes (list :san move))
- (assert changes)
- (or ply (apply 'chess-ply-create position trust changes)))))
+ (apply 'chess-ply-create position trust changes)))))
(defsubst chess-ply--move-text (ply long)
(or (and (chess-ply-keyword ply :castle) "O-O")