summaryrefslogtreecommitdiff
path: root/src/object1.c
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2012-03-04 17:47:43 +0100
committerBardur Arantsson <bardur@scientician.net>2012-03-29 20:41:39 +0200
commit4d6770696a172bae4ef18a00cb1e59f06e641faf (patch)
tree6b6475485d731f4ad2a54c84dacfaafec347f8a9 /src/object1.c
parent120fed37d8974553e25e5c83ba74c1bb08d71404 (diff)
Refactor: Remove duplicate code for accessing inventory/floor object
Diffstat (limited to 'src/object1.c')
-rw-r--r--src/object1.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/src/object1.c b/src/object1.c
index fe91b805..fef7fb85 100644
--- a/src/object1.c
+++ b/src/object1.c
@@ -4899,17 +4899,8 @@ bool_ verify(cptr prompt, int item)
object_type *o_ptr;
- /* Inventory */
- if (item >= 0)
- {
- o_ptr = &p_ptr->inventory[item];
- }
-
- /* Floor */
- else
- {
- o_ptr = &o_list[0 - item];
- }
+ /* Get object */
+ o_ptr = get_object(item);
/* Describe */
object_desc(o_name, o_ptr, TRUE, 3);
@@ -4933,17 +4924,8 @@ static bool_ get_item_allow(int item)
object_type *o_ptr;
- /* Inventory */
- if (item >= 0)
- {
- o_ptr = &p_ptr->inventory[item];
- }
-
- /* Floor */
- else
- {
- o_ptr = &o_list[0 - item];
- }
+ /* Get object */
+ o_ptr = get_object(item);
/* No inscription */
if (!o_ptr->note) return (TRUE);