Rev 82 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 82 | Rev 177 | ||
|---|---|---|---|
| Line 141... | Line 141... | ||
| 141 | // now, disambiguate. |
141 | // now, disambiguate. |
| 142 | return (SAN_DisambiguateMove (move, new_move)); |
142 | return (SAN_DisambiguateMove (move, new_move)); |
| 143 | } |
143 | } |
| 144 | 144 | ||
| 145 | 145 | ||
| 146 | bool Move_DescribeInSAN (boardmove_t * |
146 | bool Move_DescribeInSAN (boardmove_t *move, boardmove_t *previousmove) |
| 147 | { |
147 | { |
| 148 | // convert a board and its part placements into a SAN notation, writing in the pgntext buffer |
148 | // convert a board and its part placements into a SAN notation, writing in the pgntext buffer |
| 149 | 149 | ||
| 150 | int line; |
150 | int line; |
| 151 | int column; |
151 | int column; |
| Line 192... | Line 192... | ||
| 192 | { |
192 | { |
| 193 | slot = &move->slots[line][column]; // quick access to slot |
193 | slot = &move->slots[line][column]; // quick access to slot |
| 194 | 194 | ||
| 195 | // is this slot occupied by one of our siblings that is not the one doing the move AND its movement is valid ? |
195 | // is this slot occupied by one of our siblings that is not the one doing the move AND its movement is valid ? |
| 196 | if ((slot->part == move->part) && (slot->color == move->color) && ((line != move->source[0]) || (column != move->source[1])) |
196 | if ((slot->part == move->part) && (slot->color == move->color) && ((line != move->source[0]) || (column != move->source[1])) |
| 197 | && Move_IsMoveValid ( |
197 | && Move_IsMoveValid (previousmove, line, column, move->target[0], move->target[1])) |
| 198 | { |
198 | { |
| 199 | if (column != move->source[1]) |
199 | if (column != move->source[1]) |
| 200 | needs_column = true; // if columns differ, remember to write start column |
200 | needs_column = true; // if columns differ, remember to write start column |
| 201 | else |
201 | else |
| 202 | needs_line = true; // else if lines differ, remember to write start line |
202 | needs_line = true; // else if lines differ, remember to write start line |