dx = ff - tf;
dy = fr - tr;
- if (dy == gs->onMove == WHITE ? 2 : -2) {
+ if (dy == (gs->onMove == WHITE ? -2 : 2)) {
if (abs(dx) == 1)
return 1;
}
switch(piecetype(piece)) {
case PAWN:
case LANCE:
- case KNIGHT:
+ case HONORABLEHORSE:
case SILVER:
promote = GOLD; break;
case BISHOP:
}
} else
switch(piecetype(piece)) { // force mandatory promotions
- case KNIGHT:
+ case HONORABLEHORSE:
if(mt->toRank == 1 || mt->toRank == gs->files-2) promote = GOLD;
case PAWN:
case LANCE:
}\r
for (InitPieceLoop(gs->board, &f, &r, gs->onMove);\r
NextPieceLoop(gs->board, &f, &r, gs->onMove, gs->files, gs->ranks);) {\r
- if (legal_move(gs, f, r, kf, kr)) { /* In Check? */\r
+ if (legal_move(gs, f, r, kf, kr)) { /* In Check? */
return 1;\r
}\r
}\r