right order of ifs

master
thunic 2 years ago
parent 8535b94b00
commit b37dbd909e

@ -187,14 +187,13 @@ int revealCell(int** gameBoard, int** hiddenGameBoard, int size, int row, int co
if (hiddenGameBoard[pos.row][pos.col] != HIDDEN_CELL) { if (hiddenGameBoard[pos.row][pos.col] != HIDDEN_CELL) {
return 1; return 1;
} }
if (gameBoard[pos.row][pos.col] == FLAG_CELL){
return 1;
}
if (gameBoard[pos.row][pos.col] == BOMB_CELL) { if (gameBoard[pos.row][pos.col] == BOMB_CELL) {
handleBombExploded(); handleBombExploded();
return 0; return 0;
} }
if (gameBoard[pos.row][pos.col] == FLAG_CELL){
return 1;
}
// Wenn die Zelle leer ist, müssen auch benachbarte leere Zellen aufgedeckt werden // Wenn die Zelle leer ist, müssen auch benachbarte leere Zellen aufgedeckt werden
if (gameBoard[pos.row][pos.col] == EMPTY_CELL) { if (gameBoard[pos.row][pos.col] == EMPTY_CELL) {
revealEmptyCells(gameBoard, hiddenGameBoard, size, pos); revealEmptyCells(gameBoard, hiddenGameBoard, size, pos);

Loading…
Cancel
Save