Make throwable prioritize weapons and other throwables
parent
b2d044ce6a
commit
89b5ea6db0
|
@ -1792,7 +1792,23 @@ static object *find_throw_ob(object *op, const char *request) {
|
|||
}
|
||||
}
|
||||
|
||||
/* look through the inventory */
|
||||
/* look through the inventory for high-priority throwables first */
|
||||
if (tmp == NULL) {
|
||||
for (tmp = op->inv; tmp != NULL; tmp = tmp->below) {
|
||||
if (!(tmp->type == WEAPON || tmp->subtype == POT_THROW || tmp->subtype == POT_DUST))
|
||||
continue;
|
||||
/* can't toss invisible or inv-locked items */
|
||||
if (tmp->invisible || QUERY_FLAG(tmp, FLAG_INV_LOCKED))
|
||||
continue;
|
||||
query_name(tmp, name, MAX_BUF);
|
||||
if (!request
|
||||
|| !strcmp(name, request)
|
||||
|| !strcmp(tmp->name, request))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* look through the inventory for others */
|
||||
if (tmp == NULL) {
|
||||
for (tmp = op->inv; tmp != NULL; tmp = tmp->below) {
|
||||
/* can't toss invisible or inv-locked items */
|
||||
|
|
Loading…
Reference in New Issue