Unify hero free hand check and msg
This commit is contained in:
@@ -1701,6 +1701,7 @@ E struct obj *FDECL(pick_obj, (struct obj *));
|
||||
E int NDECL(encumber_msg);
|
||||
E int NDECL(doloot);
|
||||
E boolean FDECL(container_gone, (int (*)(OBJ_P)));
|
||||
E boolean NDECL(u_handsy);
|
||||
E int FDECL(use_container, (struct obj **,int));
|
||||
E int FDECL(loot_mon, (struct monst *,int *,boolean *));
|
||||
E int NDECL(dotip);
|
||||
|
||||
23
src/pickup.c
23
src/pickup.c
@@ -2099,6 +2099,19 @@ explain_container_prompt()
|
||||
}
|
||||
}
|
||||
|
||||
boolean
|
||||
u_handsy()
|
||||
{
|
||||
if (nohands(youmonst.data)) {
|
||||
You("have no hands!"); /* not `body_part(HAND)' */
|
||||
return FALSE;
|
||||
} else if (!freehand()) {
|
||||
You("have no free %s.", body_part(HAND));
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static const char stashable[] = { ALLOW_COUNT, COIN_CLASS, ALL_CLASSES, 0 };
|
||||
|
||||
int
|
||||
@@ -2115,13 +2128,9 @@ int held;
|
||||
int used = 0;
|
||||
|
||||
emptymsg[0] = '\0';
|
||||
if (nohands(youmonst.data)) {
|
||||
You("have no hands!"); /* not `body_part(HAND)' */
|
||||
return 0;
|
||||
} else if (!freehand()) {
|
||||
You("have no free %s.", body_part(HAND));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!u_handsy()) return 0;
|
||||
|
||||
if (obj->olocked) {
|
||||
pline("%s locked.", Tobjnam(obj, "are"));
|
||||
if (held) You("must put it down to unlock.");
|
||||
|
||||
@@ -46,14 +46,7 @@ use_saddle(otmp)
|
||||
const char *s;
|
||||
|
||||
|
||||
/* Can you use it? */
|
||||
if (nohands(youmonst.data)) {
|
||||
You("have no hands!"); /* not `body_part(HAND)' */
|
||||
return 0;
|
||||
} else if (!freehand()) {
|
||||
You("have no free %s.", body_part(HAND));
|
||||
return 0;
|
||||
}
|
||||
if (!u_handsy()) return 0;
|
||||
|
||||
/* Select an animal */
|
||||
if (u.uswallow || Underwater || !getdir((char *)0)) {
|
||||
|
||||
Reference in New Issue
Block a user