Closed jazzyb closed 12 years ago
The issue was in fc_game_convert_coords_to_move() in game.c. I had forgotten to update the game API to account for opp_player and opp_piece being added to the move struct. This has been broken for a really long time without me noticing anything. I really need to (1) perform better validation testing before any major commits (simply running ./a.out and not seeing a crash won't do it anymore) and (2) revamp or completely get rid of the game API -- it is complete trash and the one part of this library which isn't relatively well-written.
In commit d746891b63ef6c595c3aa641fc6066fd4dd52109.
The example program when run with the parameters
-d 4 2 4
results in a segfault for the moves (1: d1-e1 a5-a4 e5-e4 h4-h5).The following GDB output shows that an assertion is failing in fc_get_pawn_moves() where the program can't find the orientation of a particular pawn.