Fix warnings

master
Tait Hoyem 5 years ago
parent 472ff827a8
commit 096676fc36

@ -175,18 +175,18 @@ int main(){
}
if (moving_piece == W_ROOK){
if (moving_from_pos == Position::A1 &&
(castle_perms & CastlePerms::WQS == 1)){
((castle_perms & CastlePerms::WQS) == CastlePerms::WQS)){
castle_perms -= CastlePerms::WQS;
} else if (moving_from_pos == Position::H1 &&
(castle_perms & CastlePerms::WKS == 1)){
((castle_perms & CastlePerms::WKS) == CastlePerms::WKS)){
castle_perms -= CastlePerms::WKS;
}
} else if (moving_piece == B_ROOK){
if (moving_from_pos == Position::H8 &&
(castle_perms & CastlePerms::BKS == 1)){
((castle_perms & CastlePerms::BKS) == CastlePerms::BKS)){
castle_perms -= CastlePerms::BKS;
} else if (moving_from_pos == Position::A8 &&
(castle_perms & CastlePerms::BQS == 1)){
((castle_perms & CastlePerms::BQS) == CastlePerms::BQS)){
castle_perms -= CastlePerms::BQS;
}
}

@ -136,7 +136,6 @@ void add_checked_flags(PieceType pt, std::array<PieceType, 120> *board, std::vec
void filter_checked_moves(PieceType pt, std::array<PieceType, 120> *board, std::vector<int> *pns){
PieceType my_king = is_white(pt)?PieceType::W_KING:PieceType::B_KING;
int my_king_pos = get_pos_of(my_king, board);
int attackers = 0;
bool remove_all_castles = false;
for (auto p_pn= pns->begin(); p_pn!=pns->end();){
if (get_castle_flag(*p_pn) == 1){
@ -148,6 +147,8 @@ void filter_checked_moves(PieceType pt, std::array<PieceType, 120> *board, std::
++p_pn;
break;
}
// TODO: Make this more effecient.
// There is no way in hell, this is as complicated as it seems.
// If moved left
// Queenside
if ((get_from_sq(*p_pn) - get_to_sq(*p_pn)) > 0){

Loading…
Cancel
Save