In the case where the AI wall blocks all winning paths, and the wall is not placed on the board, I added 1 to the ai.numAIWallsRemaining so that the AI does not lose that wall.