- // OK, not a drop move
- if (
- this.hasCastle &&
- // If flags already off, no need to re-check:
- Object.keys(this.castleFlags).some(c => {
- return this.castleFlags[c].some(val => val < this.size.y)})
- ) {
- this.updateCastleFlags(move);
- }
- const initSquare = C.CoordsToSquare(move.start);
- if (
- this.options["crazyhouse"] &&
- (!this.options["rifle"] || !move.capture)
- ) {
+ this.updateCastleFlags(move);
+ }
+ if (this.options["crazyhouse"]) {
+ move.vanish.forEach(v => {
+ const square = C.CoordsToSquare({x: v.x, y: v.y});
+ if (this.ispawn[square])
+ delete this.ispawn[square];
+ });
+ if (move.appear.length > 0 && move.vanish.length > 0) {
+ // Assumption: something is moving
+ const initSquare = C.CoordsToSquare(move.start);