// A capture occured (m.vanish.length == 2)
m.appear[0].c = "c";
moves.push(m);
- if (m.appear[0].p != m.vanish[1].p //avoid promotions:
+ if (m.appear[0].p != m.vanish[1].p //avoid promotions (already treated):
&& (m.vanish[0].p != VariantRules.PAWN || m.end.x != lastRank))
{
// Add transformation into captured piece
notation = startColumn + "x" + finalSquare + "=" + move.appear[0].p.toUpperCase();
}
else //no capture
+ {
notation = finalSquare;
- if (move.appear.length > 0 && piece != move.appear[0].p) //promotion
- notation += "=" + move.appear[0].p.toUpperCase();
+ if (move.appear.length > 0 && piece != move.appear[0].p) //promotion
+ notation += "=" + move.appear[0].p.toUpperCase();
+ }
return notation;
}