MCPcopy Index your code
hub / github.com/NetHack/NetHack / inuse_classify

Function inuse_classify

src/invent.c:69–81  ·  view source on GitHub ↗

sortloot() classification for in-use sort; called at most once [per sort] for each object */

Source from the content-addressed store, hash-verified

67/* sortloot() classification for in-use sort;
68 called at most once [per sort] for each object */
69staticfn void
70inuse_classify(Loot *sort_item, struct obj *obj)
71{
72 long w_mask = (obj->owornmask & (W_ACCESSORY | W_WEAPONS | W_ARMOR));
73 int rating = 0, altclass = 0;
74
75#define USE_RATING(test) \
76 do { \
77 /* 'rating' advances for each USE_RATING() call */ \
78 ++rating; \
79 if ((test) != 0) \
80 goto assign_rating; \
81 } while (0)
82
83 /*
84 * In order of importance, least to most, somewhat arbitrarily.

Callers 1

sortloot_cmpFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected