File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -2008,6 +2008,20 @@ Variant* Variant::conclude() {
20082008 if (!doubleStepRegion[WHITE] && !doubleStepRegion[BLACK])
20092009 doubleStep = false ;
20102010
2011+ PieceSet originalPieceTypes = pieceTypes;
2012+ PieceSet potionPieces = NO_PIECE_SET;
2013+ if (potions)
2014+ for (int idx = 0 ; idx < Variant::POTION_TYPE_NB; ++idx)
2015+ {
2016+ PieceType potion = potionPiece[idx];
2017+ if (potion != NO_PIECE_TYPE)
2018+ {
2019+ pieceTypes |= piece_set (potion);
2020+ if (!(originalPieceTypes & piece_set (potion)))
2021+ potionPieces |= piece_set (potion);
2022+ }
2023+ }
2024+
20112025 // Determine optimizations
20122026 bool restrictedMobility = false ;
20132027 for (PieceSet ps = pieceTypes; !restrictedMobility && ps;)
@@ -2016,12 +2030,14 @@ Variant* Variant::conclude() {
20162030 if (mobilityRegion[WHITE][pt] || mobilityRegion[BLACK][pt])
20172031 restrictedMobility = true ;
20182032 }
2019- fastAttacks = !(pieceTypes & ~(CHESS_PIECES | COMMON_FAIRY_PIECES))
2033+ PieceSet boardPieceTypes = pieceTypes & ~potionPieces;
2034+
2035+ fastAttacks = !(boardPieceTypes & ~(CHESS_PIECES | COMMON_FAIRY_PIECES))
20202036 && kingType == KING
20212037 && !restrictedMobility
20222038 && !cambodianMoves
20232039 && !diagonalLines;
2024- fastAttacks2 = !(pieceTypes & ~(SHOGI_PIECES | COMMON_STEP_PIECES))
2040+ fastAttacks2 = !(boardPieceTypes & ~(SHOGI_PIECES | COMMON_STEP_PIECES))
20252041 && kingType == KING
20262042 && !restrictedMobility
20272043 && !cambodianMoves
You can’t perform that action at this time.
0 commit comments