From 7dc4512bb35cddda5c972f6358be0ad543e26d1a Mon Sep 17 00:00:00 2001 From: nhmall Date: Tue, 9 Dec 2025 15:25:10 -0500 Subject: [PATCH] follow-up: just use existing carrying() --- include/extern.h | 1 - src/do_name.c | 2 +- src/invent.c | 12 ------------ 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/include/extern.h b/include/extern.h index 4ac5b3b1e..8a5056d91 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1360,7 +1360,6 @@ extern void perm_invent_toggled(boolean negated); extern void prepare_perminvent(winid window); extern struct obj *carrying_stoning_corpse(void); extern void repopulate_perminvent(void); -extern boolean hero_has_one_of_these(short); /* ### ioctl.c ### */ diff --git a/src/do_name.c b/src/do_name.c index 746f99959..c27396343 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -671,7 +671,7 @@ docall(struct obj *obj) *uname_p = dupstr(buf); discover_object(obj->otyp, FALSE, TRUE, TRUE); /* possibly add to disco[] */ } - if (obj->where == OBJ_INVENT || hero_has_one_of_these(obj->otyp)) + if (obj->where == OBJ_INVENT || carrying(obj->otyp)) update_inventory(); } diff --git a/src/invent.c b/src/invent.c index 2983b2997..f3c7f3803 100644 --- a/src/invent.c +++ b/src/invent.c @@ -2779,18 +2779,6 @@ learn_unseen_invent(void) update_inventory(); } -boolean -hero_has_one_of_these(short otyp) -{ - struct obj *otmp; - - for (otmp = gi.invent; otmp; otmp = otmp->nobj) { - if (otmp->otyp == otyp) - return TRUE; - } - return FALSE; -} - /* persistent inventory window is maintained by interface code; 'update_inventory' used to be a macro for (*windowprocs.win_update_inventory) but the restore hackery to suppress