summaryrefslogtreecommitdiff
path: root/chess-display.el
diff options
context:
space:
mode:
authorMario Lang <mlang@delysid.org>2014-03-30 17:07:11 +0200
committerMario Lang <mlang@delysid.org>2014-03-30 17:07:11 +0200
commit045a93cb98dfd320e756ea9d9799ea92f0900bc6 (patch)
tree9fc4866e41c4beccba91422ce8df4270800f9d58 /chess-display.el
parent6cf486ed5c05ccf7af0b0f569a574c2f9a221364 (diff)
Try to fix a reentrancy bug in chess-display-move.
The problem occurs with engine modules which reply to move events with move events directly, i.e. cvhess-ai and chess-uci when replying with a book move. Since chess-display-move first performs chess-game-move followed by chess-display-paint-move, we end up with the plies getting painted in reverse. This is visible when pieces are taken. If we paint the move first and then emit the move event on the game, the problem goes away.
Diffstat (limited to 'chess-display.el')
-rw-r--r--chess-display.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/chess-display.el b/chess-display.el
index ffe20eb..6bf03df 100644
--- a/chess-display.el
+++ b/chess-display.el
@@ -376,8 +376,8 @@ If only START is given, it must be in algebraic move notation."
(chess-error 'game-is-over)))
(if (= chess-display-index (chess-game-index chess-module-game))
(let ((chess-display-handling-event t))
- (chess-game-move chess-module-game ply)
(chess-display-paint-move nil ply)
+ (chess-game-move chess-module-game ply)
(chess-display-set-index* nil (chess-game-index chess-module-game)))
;; jww (2002-03-28): This should beget a variation within the
;; game, or alter the game, just as SCID allows