X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FAbsorption.js;h=33c8351789925a1e71a906a41c8d49168e8ccdd4;hp=c6e1de7476af0c61f08a69d059f0907ee4016efa;hb=e023d74715d327ebd7623079cb778b0def0a1464;hpb=afcfb85255ee152e3d6bced74260f586ced0f3e8 diff --git a/client/src/variants/Absorption.js b/client/src/variants/Absorption.js index c6e1de74..33c83517 100644 --- a/client/src/variants/Absorption.js +++ b/client/src/variants/Absorption.js @@ -91,10 +91,13 @@ export class AbsorptionRules extends ChessRules { ); }); moves.forEach(m => { - if (m.vanish.length == 2) { + if ( + m.vanish.length == 2 && + m.appear.length == 1 && + piece != m.vanish[1].p + ) { // Augment pieces abilities in case of captures - const piece2 = m.vanish[1].p; - if (piece != piece2) m.appear[0].p = V.Fusion(piece, piece2); + m.appear[0].p = V.Fusion(piece, m.vanish[1].p); } }); return moves;