Sweep promotions of multiple pieces to Tokin were not working, because
once the promoted version was shown it would always demote to Pawn.
Now the toggle always demotes to the selected piece.
{ // change piece into promotion partner if one shogi-promotes to the other
ChessSquare partner = promoPartner[*p];
if(PieceToChar(*p) != '+' && PieceToChar(partner) != '+') return 0;
+ if(PieceToChar(*p) == '+') partner = boards[currentMove][fromY][fromX];
*p = partner;
return 1;
}
for(p=0; p<EmptySquare; p++) if(table[p] == partner[i]) break;
if(c == '^') table[i] = '+';
if(p < EmptySquare) promoPartner[p] = i, promoPartner[i] = p; // marry them
- } else if(c == '*') promoPartner[i] = (i < BlackPawn ? WhiteTokin : BlackTokin); // promotes to Tokin
+ } else if(c == '*') {
+ table[i] = partner[i];
+ promoPartner[i] = (i < BlackPawn ? WhiteTokin : BlackTokin); // promotes to Tokin
+ }
}
}