diff --git a/server/skills.c b/server/skills.c index 824c4c3..d57e2ca 100644 --- a/server/skills.c +++ b/server/skills.c @@ -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 */