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:
Sahil Sareen 2015-02-21 12:23:59 +05:30
parent fe69cc5a02
commit 17a7b87f81

View file

@ -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;
}