diff --git a/src/wield.c b/src/wield.c index 11565e3bf..6920c9433 100644 --- a/src/wield.c +++ b/src/wield.c @@ -52,10 +52,10 @@ * No item may be in more than one of these slots. */ -static boolean cant_wield_corpse(struct obj *); -static int ready_weapon(struct obj *); -static int ready_ok(struct obj *); -static int wield_ok(struct obj *); +static boolean cant_wield_corpse(struct obj *) NONNULLARG1; +static int ready_weapon(struct obj *) NO_NNARGS; +static int ready_ok(struct obj *) NO_NNARGS; +static int wield_ok(struct obj *) NO_NNARGS; /* used by will_weld() */ /* probably should be renamed */ @@ -676,7 +676,7 @@ wield_tool(struct obj *obj, const char *what; boolean more_than_1; - if (obj == uwep) + if (uwep && obj == uwep) return TRUE; /* nothing to do if already wielding it */ if (!verb) @@ -690,7 +690,7 @@ wield_tool(struct obj *obj, more_than_1 ? "them" : "it"); return FALSE; } - if (welded(uwep)) { + if (uwep && welded(uwep)) { if (flags.verbose) { const char *hand = body_part(HAND); @@ -737,7 +737,7 @@ wield_tool(struct obj *obj, if (flags.pushweapon && oldwep && uwep != oldwep) setuswapwep(oldwep); } - if (uwep != obj) + if (uwep && uwep != obj) return FALSE; /* rewielded old object after dying */ /* applying weapon or tool that gets wielded ends two-weapon combat */ if (u.twoweap)