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

Function allunworn

src/worn.c:187–201  ·  view source on GitHub ↗

called when saving with FREEING flag set has just discarded inventory */

Source from the content-addressed store, hash-verified

185
186/* called when saving with FREEING flag set has just discarded inventory */
187void
188allunworn(void)
189{
190 const struct worn *wp;
191
192 u.twoweap = 0; /* uwep and uswapwep are going away */
193 /* remove stale pointers; called after the objects have been freed
194 (without first being unworn) while saving invent during game save;
195 note: uball and uchain might not be freed yet but we clear them
196 here anyway (savegamestate() and its callers deal with them) */
197 for (wp = worn; wp->w_mask; wp++) {
198 /* object is already gone so we don't/can't update is owornmask */
199 *(wp->w_obj) = (struct obj *) 0;
200 }
201}
202
203
204/* return item worn in slot indicated by wornmask; needed by poly_obj() */

Callers 1

saveobjchnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected