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

Function wearmask_to_obj

src/worn.c:205–214  ·  view source on GitHub ↗

return item worn in slot indicated by wornmask; needed by poly_obj() */

Source from the content-addressed store, hash-verified

203
204/* return item worn in slot indicated by wornmask; needed by poly_obj() */
205struct obj *
206wearmask_to_obj(long wornmask)
207{
208 const struct worn *wp;
209
210 for (wp = worn; wp->w_mask; wp++)
211 if (wp->w_mask & wornmask)
212 return *wp->w_obj;
213 return (struct obj *) 0;
214}
215
216/* convert an armor wornmask to corresponding category */
217int

Callers 2

itemactionsFunction · 0.85
poly_objFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected