gi.invalid_obj -> hands_obj
This commit is contained in:
10
src/invent.c
10
src/invent.c
@@ -1527,13 +1527,13 @@ any_obj_ok(struct obj *obj)
|
||||
* getobj returns:
|
||||
* struct obj *xxx: object to do something with.
|
||||
* (struct obj *) 0 error return: no object.
|
||||
* &gi.invalid_obj explicitly no object (as in w-).
|
||||
* &hands_obj explicitly no object (as in w-).
|
||||
* The obj_ok callback should not have side effects (apart from
|
||||
* abnormal-behavior things like impossible calls); it can be called multiple
|
||||
* times on the same object during the execution of this function.
|
||||
* Callbacks' argument is either a valid object pointer or a null pointer,
|
||||
* which represents the validity of doing that action on HANDS_SYM. getobj
|
||||
* won't call it with &gi.invalid_obj, so its behavior can be undefined in that
|
||||
* won't call it with &hands_obj, so its behavior can be undefined in that
|
||||
* case.
|
||||
*/
|
||||
struct obj *
|
||||
@@ -1579,7 +1579,7 @@ getobj(
|
||||
/* check whether the hands/self choice is suitable */
|
||||
v = (*obj_ok)((struct obj *) 0);
|
||||
if (v == GETOBJ_SUGGEST || v == GETOBJ_DOWNPLAY)
|
||||
otmp = &gi.invalid_obj;
|
||||
otmp = &hands_obj;
|
||||
} else {
|
||||
/* there could be more than one match if key is '#';
|
||||
take first one which passes the obj_ok callback */
|
||||
@@ -1742,7 +1742,7 @@ getobj(
|
||||
if (ilet == HANDS_SYM) { /* '-' */
|
||||
if (!allownone)
|
||||
mime_action(word);
|
||||
return (allownone ? &gi.invalid_obj : (struct obj *) 0);
|
||||
return (allownone ? &hands_obj : (struct obj *) 0);
|
||||
}
|
||||
redo_menu:
|
||||
/* since gold is now kept in inventory, we need to do processing for
|
||||
@@ -1778,7 +1778,7 @@ getobj(
|
||||
continue;
|
||||
}
|
||||
if (ilet == HANDS_SYM)
|
||||
return &gi.invalid_obj;
|
||||
return &hands_obj;
|
||||
if (ilet == '\033') {
|
||||
if (flags.verbose)
|
||||
pline1(Never_mind);
|
||||
|
||||
Reference in New Issue
Block a user