From 197b2f4db5064081896c9020685158adeb3819ff Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Mon, 26 Oct 2009 20:38:37 -0700 Subject: [PATCH] more work on variant switch the previous solution to the cosmetic problem of displaying a wrong shuffle in an ICS game that was observed from the very start unfortunately turned out to cause a real error in diplaying a stored game through the smoves command, for variants not using the FIDE setup as standard. This patch displays the position from before setting up the start position of the new variant, but does setup boards[0] to the initial position of that variant. (If this is a wrong shuffle, it is thus ot displayed, and a new board will immediately be sent from the ICS to correct the shuffle.) --- backend.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/backend.c b/backend.c index a8a44cb..0db2b76 100755 --- a/backend.c +++ b/backend.c @@ -2016,8 +2016,7 @@ VariantSwitch(Board board, VariantClass newVariant) } else gameInfo.variant = newVariant; CopyBoard(oldBoard, board); // remember correctly formatted board InitPosition(FALSE); /* this sets up board[0], but also other stuff */ - if(currentMove == 0) CopyBoard(board, oldBoard); // preserve start position - DrawPosition(TRUE, boards[currentMove]); + DrawPosition(TRUE, currentMove ? boards[currentMove] : oldBoard); } static int loggedOn = FALSE; -- 1.7.0.4