Browse Source

Bauernumwandlung.c warnings entfernt, Emman Mensdorf

main
Emman Mensdorf 11 months ago
parent
commit
4955214eb1
  1. 14
      src/Bauernumwandlung.c

14
src/Bauernumwandlung.c

@ -40,26 +40,26 @@ char* bauer_umwandel_abfrage(char** Brett, int startX, int startY, int endX, int
if(player == PLAYER_WHITE){
printf("Q for Queen, R for Rook, B for Bishop, or N for Knight");
//Figur = getUserInput();
Figur = 'Q';
Figur = "Q";
}else{
printf("q for Queen, r for Rook, b for Bishop, or n for Knight");
//Figur = getUserInput();
Figur = 'q';
Figur = "q";
}
if ((player == PLAYER_WHITE && (Figur == 'Q' || Figur == 'R' || Figur == 'B' || Figur == 'N')) ||
(player == PLAYER_BLACK && (Figur == 'q' || Figur == 'r' || Figur == 'b' || Figur == 'n'))) {
if ((player == PLAYER_WHITE && (*Figur == 'Q' || *Figur == 'R' || *Figur == 'B' || *Figur == 'N')) ||
(player == PLAYER_BLACK && (*Figur == 'q' || *Figur == 'r' || *Figur == 'b' || *Figur == 'n'))) {
return Figur;
} else {
return 'W'; // Undefiniertes Zeichen als Fehlerwert
return (char *)'W'; // Undefiniertes Zeichen als Fehlerwert
}
}
void bauer_umwandeln(char** Brett, int startX, int startY, int endX, int endY, Player player) {
char Figur = bauer_umwandel_abfrage(Brett, startX, startY, endX, endY, player);
char* Figur = bauer_umwandel_abfrage(Brett, startX, startY, endX, endY, player);
Brett[endY][endX] = Figur;
Brett[endY][endX] = *Figur;
Brett[startY][startX] = ' ';
}
Loading…
Cancel
Save