Fixed the AI's king-in-check logic