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

Function erosion_matters

src/objnam.c:1194–1215  ·  view source on GitHub ↗

used to prevent rust on items where rust makes no difference */

Source from the content-addressed store, hash-verified

1192
1193/* used to prevent rust on items where rust makes no difference */
1194boolean
1195erosion_matters(struct obj *obj)
1196{
1197 switch (obj->oclass) {
1198 case TOOL_CLASS:
1199 /* it's possible for a rusty weptool to be polymorphed into some
1200 non-weptool iron tool, in which case the rust implicitly goes
1201 away, but it's also possible for it to be polymorphed into a
1202 non-iron tool, in which case rust also implicitly goes away,
1203 so there's no particular reason to try to handle the first
1204 instance differently [this comment belongs in poly_obj()...] */
1205 return is_weptool(obj) ? TRUE : FALSE;
1206 case WEAPON_CLASS:
1207 case ARMOR_CLASS:
1208 case BALL_CLASS:
1209 case CHAIN_CLASS:
1210 return TRUE;
1211 default:
1212 break;
1213 }
1214 return FALSE;
1215}
1216
1217#define DONAME_WITH_PRICE 1
1218#define DONAME_VAGUE_QUAN 2

Callers 7

destroy_armFunction · 0.85
readobjnamFunction · 0.85
mergableFunction · 0.85
may_generate_erodedFunction · 0.85
erode_objFunction · 0.85
poly_objFunction · 0.85
seffect_enchant_weaponFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected