diff --git a/Userland/Games/Chess/ChessWidget.cpp b/Userland/Games/Chess/ChessWidget.cpp index 3438a27545..4ce5458728 100644 --- a/Userland/Games/Chess/ChessWidget.cpp +++ b/Userland/Games/Chess/ChessWidget.cpp @@ -697,7 +697,7 @@ bool ChessWidget::check_game_over(ClaimDrawBehavior claim_draw_behavior) case Chess::Board::Result::FiftyMoveRule: if (claim_draw_behavior == ClaimDrawBehavior::Prompt) { update(); - auto dialog_result = GUI::MessageBox::show(window(), "50 moves have elapsed without a capture. Claim Draw?"sv, "Claim Draw?"sv, + auto dialog_result = GUI::MessageBox::show(window(), "50 moves have elapsed without a capture or pawn advance. Claim Draw?"sv, "Claim Draw?"sv, GUI::MessageBox::Type::Information, GUI::MessageBox::InputType::YesNo); if (dialog_result != GUI::Dialog::ExecResult::Yes) diff --git a/Userland/Libraries/LibChess/Chess.cpp b/Userland/Libraries/LibChess/Chess.cpp index 429b256bdb..ccb703bb37 100644 --- a/Userland/Libraries/LibChess/Chess.cpp +++ b/Userland/Libraries/LibChess/Chess.cpp @@ -774,9 +774,11 @@ Board::Result Board::game_result() const }); if (are_legal_moves) { - if (m_moves_since_capture >= 75 * 2) + if (m_moves_since_capture >= 75 * 2 && m_moves_since_pawn_advance >= 75 * 2) return Result::SeventyFiveMoveRule; - if (m_moves_since_capture == 50 * 2) + + if ((m_moves_since_capture >= 50 * 2 && m_moves_since_pawn_advance == 50 * 2) + || (m_moves_since_pawn_advance >= 50 * 2 && m_moves_since_capture == 50 * 2)) return Result::FiftyMoveRule; auto repeats = m_previous_states.get(Traits::hash(*this));