discard a recorded achievement; return True if removed, False otherwise */
| 2473 | |
| 2474 | /* discard a recorded achievement; return True if removed, False otherwise */ |
| 2475 | boolean |
| 2476 | remove_achievement(schar achidx) |
| 2477 | { |
| 2478 | int i; |
| 2479 | |
| 2480 | for (i = 0; u.uachieved[i]; ++i) |
| 2481 | if (abs(u.uachieved[i]) == abs(achidx)) |
| 2482 | break; /* stop when found */ |
| 2483 | if (!u.uachieved[i]) /* not found */ |
| 2484 | return FALSE; |
| 2485 | /* list is 0 terminated so any beyond the removed one move up a slot */ |
| 2486 | do { |
| 2487 | u.uachieved[i] = u.uachieved[i + 1]; |
| 2488 | } while (u.uachieved[++i]); |
| 2489 | return TRUE; |
| 2490 | } |
| 2491 | |
| 2492 | /* used to decide whether there are any achievements to display */ |
| 2493 | int |
no outgoing calls
no test coverage detected