diff --git a/src/Bauernumwandlung.c b/src/Bauernumwandlung.c index a93aa14..f06454e 100644 --- a/src/Bauernumwandlung.c +++ b/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] = ' '; } \ No newline at end of file