Correct backup pieces for addition of minor Lion
authorH.G.Muller <hgm@hgm-xboard.(none)>
Mon, 11 Jan 2016 10:35:22 +0000 (11:35 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Mon, 11 Jan 2016 10:35:22 +0000 (11:35 +0100)
The added piece type was not put in the list of backup pieces, so that
the pieces beyond it got out of phase, and no backup for the Prince
would be found, leading to an error popup about missing default pieces.
The error message on this has now been improved to mention the piece
casing the trouble.

draw.c

diff --git a/draw.c b/draw.c
index 81f5392..b88d53d 100644 (file)
--- a/draw.c
+++ b/draw.c
@@ -298,7 +298,7 @@ char *pngPieceNames[] = // must be in same order as internal piece encoding
 };
 
 char *backupPiece[] = { "Princess", NULL, NULL, NULL, NULL, NULL, NULL,
-                        NULL, NULL, NULL, NULL, NULL,
+                        NULL, NULL, NULL, NULL, NULL, NULL,
                        NULL, NULL, NULL, NULL, NULL, NULL, "King", "Queen", "Lion" }; // pieces that map on other when not kanji
 
 RsvgHandle *
@@ -373,7 +373,7 @@ ScaleOnePiece (int color, int piece)
     if(!(svgPieces[color][piece] = LoadSVG(svgDir, color, piece, 0)) // try to fall back on installed svg 
        && !warned && strcmp(pngPieceNames[piece], "Tile")) {         // but do not complain about missing 'Tile'
       char *msg = _("No default pieces installed!\nSelect your own using '-pieceImageDirectory'.");
-      printf("%s\n", msg); // give up
+      printf("%s (%s)\n", msg, pngPieceNames[piece]); // give up
       DisplayError(msg, 0);
       warned = 1; // prevent error message being repeated for each piece type
     }