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

Function curs_purge_perminv_data

win/curses/cursinvt.c:45–61  ·  view source on GitHub ↗

discard saved persistent inventory data */

Source from the content-addressed store, hash-verified

43
44/* discard saved persistent inventory data */
45void
46curs_purge_perminv_data(boolean everything)
47{
48 if (pi.array) {
49 unsigned idx;
50
51 for (idx = 0; idx < pi.inuseindx; ++idx)
52 free(pi.array[idx].invtxt), pi.array[idx].invtxt = 0;
53
54 if (everything)
55 free(pi.array), pi.array = 0, pi.allocsize = 0;
56 }
57
58 pi.inuseindx = 0;
59 pi.rowoffset = pi.coloffset = 0;
60 pi.widest = 0;
61}
62
63/* Runs when the game indicates that the inventory has been updated */
64void

Callers 3

curs_update_invtFunction · 0.85
curses_destroy_nhwindowFunction · 0.85
curses_update_inventoryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected