projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Pandemonium computer play
[vchess.git]
/
client
/
src
/
variants
/
Absorption.js
diff --git
a/client/src/variants/Absorption.js
b/client/src/variants/Absorption.js
index
c6e1de7
..
33c8351
100644
(file)
--- a/
client/src/variants/Absorption.js
+++ b/
client/src/variants/Absorption.js
@@
-91,10
+91,13
@@
export class AbsorptionRules extends ChessRules {
);
});
moves.forEach(m => {
);
});
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
// 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;
}
});
return moves;