From d9236358bbc4eea6a967503078ac6fc6a881d1da Mon Sep 17 00:00:00 2001 From: "H.G. Muller" Date: Wed, 29 Jun 2011 13:36:26 +0200 Subject: [PATCH] Fix drop moves on boards with more than 10 ranks The internal encoding for rank 16 is '@', and thus ambiguous with drop moves. They were always printed as 16, breaking drop games on large boards. The ambiguity is now solved (for boards with more than 16 ranks) by checking if the preceeding letter is upper case, in which case it cannot be a fileindicator, but must be a piece, and thus a drop. --- backend.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend.c b/backend.c index b5e58304..cc5fb3aa 100644 --- a/backend.c +++ b/backend.c @@ -4899,8 +4899,12 @@ SendMoveToProgram(moveNum, cps) else SendToProgram(moveList[moveNum], cps); } else if(BOARD_HEIGHT > 10) { // [HGM] big: convert ranks to double-digit where needed - snprintf(buf, MSG_SIZ, "%c%d%c%d%s", moveList[moveNum][0], moveList[moveNum][1] - '0', - moveList[moveNum][2], moveList[moveNum][3] - '0', moveList[moveNum]+4); + if(moveList[moveNum][1] == '@' && (BOARD_HEIGHT < 16 || moveList[moveNum][0] <= 'Z')) { // drop move + snprintf(buf, MSG_SIZ, "%c@%c%d%s", moveList[moveNum][0], + moveList[moveNum][2], moveList[moveNum][3] - '0', moveList[moveNum]+4); + } else + snprintf(buf, MSG_SIZ, "%c%d%c%d%s", moveList[moveNum][0], moveList[moveNum][1] - '0', + moveList[moveNum][2], moveList[moveNum][3] - '0', moveList[moveNum]+4); SendToProgram(buf, cps); } else SendToProgram(moveList[moveNum], cps); -- 2.17.1