Match object description via single function
making the code more readable. Instead of doing strcmp(OBJ_DESCR(objects[otyp]), "foo"), just call objdescr_is(obj, "foo") (via xNetHack)
This commit is contained in:
@@ -114,12 +114,10 @@ struct obj *otmp;
|
||||
}
|
||||
if (Confusion || Fumbling || Glib)
|
||||
chance -= 20;
|
||||
else if (uarmg && (s = OBJ_DESCR(objects[uarmg->otyp])) != (char *) 0
|
||||
&& !strncmp(s, "riding ", 7))
|
||||
else if (uarmg && objdescr_is(uarmg, "riding gloves"))
|
||||
/* Bonus for wearing "riding" (but not fumbling) gloves */
|
||||
chance += 10;
|
||||
else if (uarmf && (s = OBJ_DESCR(objects[uarmf->otyp])) != (char *) 0
|
||||
&& !strncmp(s, "riding ", 7))
|
||||
else if (uarmf && objdescr_is(uarmf, "riding boots"))
|
||||
/* ... or for "riding boots" */
|
||||
chance += 10;
|
||||
if (otmp->cursed)
|
||||
|
||||
Reference in New Issue
Block a user