case WhiteNonPromotion:
case BlackNonPromotion:
case NormalMove:
+ case FirstLeg:
case WhiteCapturesEnPassant:
case BlackCapturesEnPassant:
case WhiteKingSideCastle:
case WhiteNonPromotion:
case BlackNonPromotion:
case NormalMove:
+ case FirstLeg:
case WhiteCapturesEnPassant:
case BlackCapturesEnPassant:
case WhiteKingSideCastle:
result, resultDetails ? resultDetails : "(null)", whosays);
}
- fromX = fromY = -1; // [HGM] abort any move the user is entering.
+ fromX = fromY = killX = killY = -1; // [HGM] abort any move the user is entering. // [HGM] lion
if(pausing) PauseEvent(); // can happen when we abort a paused game (New Game or Quit)
ClearPremoveHighlights();
gotPremove = FALSE;
alarmSounded = FALSE;
+ killX = killY = -1; // [HGM] lion
GameEnds(EndOfFile, NULL, GE_PLAYER);
if(appData.serverMovesName != NULL) {
case WhiteNonPromotion:
case BlackNonPromotion:
case NormalMove:
+ case FirstLeg:
case WhiteKingSideCastle:
case WhiteQueenSideCastle:
case BlackKingSideCastle:
case WhiteNonPromotion:
case BlackNonPromotion:
case NormalMove:
+ case FirstLeg:
case WhiteKingSideCastle:
case WhiteQueenSideCastle:
case BlackKingSideCastle:
if (gameMode != BeginningOfGame) {
Reset(FALSE, TRUE);
}
+ killX = killY = -1; // [HGM] lion: in case we did not Reset
gameFileFP = f;
if (lastLoadGameFP != NULL && lastLoadGameFP != f) {
break;
case NormalMove:
+ case FirstLeg:
/* Only a NormalMove can be at the start of a game
* without a position diagram. */
if (lastLoadGameStart == EndOfFile ) {
if(**p == '+' && IS_SHOGI(gameInfo.variant)) { (*p)++; return '+'; }
if(**p == '=' || (gameInfo.variant == VariantSChess) && **p == '/') (*p)++; // optional = (or / for Seirawan gating)
if(**p == '(' && (*p)[2] == ')' && isalpha( (*p)[1] )) { (*p) += 3; return ToLower((*p)[-2]); }
- if(isalpha(**p)) return ToLower(*(*p)++);
+ if(isalpha(**p) && **p != 'x') return ToLower(*(*p)++); // reserve 'x' for multi-leg captures?
if(*p != start) return '='; // must be the optional =
return NULLCHAR; // no suffix detected
}
fromY = (currentMoveString[1] = coord[1] + '0') - ONE;
currentMoveString[4] = cl.promoCharIn = PromoSuffix(p);
currentMoveString[5] = NULLCHAR;
+ if(!cl.promoCharIn && (**p == '-' || **p == 'x')) { // Lion-type multi-leg move
+ currentMoveString[5] = (killX = toX) + AAA; // what we thought was to-square is in fact kill-square
+ currentMoveString[6] = (killY = toY) + ONE; // append it as suffix behind long algebraic move
+ currentMoveString[4] = ';';
+ currentMoveString[7] = NULLCHAR;
+ // read new to-square (VERY non-robust! Assumes correct (non-alpha-rank) syntax, and messes up on errors)
+ toX = cl.ftIn = (currentMoveString[2] = *++*p) - AAA; ++*p;
+ toY = cl.rtIn = (currentMoveString[3] = Number(p) + '0') - ONE;
+ }
if(type[0] != NOTHING && type[1] != NOTHING && type[3] != NOTHING) { // fully specified.
// Note that Disambiguate does not work for illegal moves, but flags them as impossible
if(piece) { // check if correct piece indicated
currentMoveString[0] = cl.ff + AAA;
currentMoveString[1] = cl.rf + ONE;
currentMoveString[3] = cl.rt + ONE;
+ if(killX < 0) // [HGM] lion: do not overwrite kill-square suffix
currentMoveString[4] = cl.promoChar;
if((cl.kind == WhiteCapturesEnPassant || cl.kind == BlackCapturesEnPassant) && (Match("ep", p) || Match("e.p.", p)));