MCPcopy Create free account
hub / github.com/NetHack/NetHack / remove_achievement

Function remove_achievement

src/insight.c:2475–2490  ·  view source on GitHub ↗

discard a recorded achievement; return True if removed, False otherwise */

Source from the content-addressed store, hash-verified

2473
2474/* discard a recorded achievement; return True if removed, False otherwise */
2475boolean
2476remove_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 */
2493int

Callers 2

show_achievementsFunction · 0.85
makemap_prepostFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected