W_WEAPON, W_ACCESSORY

Add macros W_WEAPON and W_ACCESSORY, similar to existing W_ARMOR, bitmask
of all the relevant worn bits.  Just for code readability; there should
be no change in behavior.

Also, reformat the "ugly checks" portion of getobj().  Slightly better
readability and fewer continuation lines, but only a modest improvement.
This commit is contained in:
PatR
2015-07-25 19:19:58 -07:00
parent 64dfb4fcc8
commit 9034e2a7e5
10 changed files with 152 additions and 153 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 do.c $NHDT-Date: 1436057350 2015/07/05 00:49:10 $ $NHDT-Branch: master $:$NHDT-Revision: 1.146 $ */
/* NetHack 3.6 do.c $NHDT-Date: 1437877173 2015/07/26 02:19:33 $ $NHDT-Branch: master $:$NHDT-Revision: 1.147 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -482,7 +482,7 @@ canletgo(obj, word)
struct obj *obj;
const char *word;
{
if (obj->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL)) {
if (obj->owornmask & (W_ARMOR | W_ACCESSORY)) {
if (*word)
Norep("You cannot %s %s you are wearing.", word, something);
return (FALSE);