Fix promotion code
Add a check for 'file' before trying to move. https://bugzilla.gnome.org/show_bug.cgi?id=738947
This commit is contained in:
parent
fe69cc5a02
commit
17a7b87f81
1 changed files with 3 additions and 1 deletions
|
@ -239,7 +239,9 @@ public class ChessScene : Object
|
|||
selected_file, rank, file, true, promotion_selection);
|
||||
selected_rank = selected_file = -1;
|
||||
}
|
||||
if (game.current_player.move_with_coords (selected_rank, selected_file, rank, file))
|
||||
// Need to check selected_file here again for promotion case
|
||||
if (selected_file != -1 &&
|
||||
game.current_player.move_with_coords (selected_rank, selected_file, rank, file))
|
||||
selected_rank = selected_file = -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue