summaryrefslogtreecommitdiff
path: root/src/wizard2.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/wizard2.c
parent120fed37d8974553e25e5c83ba74c1bb08d71404 (diff)
Refactor: Remove duplicate code for accessing inventory/floor object
Diffstat (limited to 'src/wizard2.c')
-rw-r--r--src/wizard2.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/wizard2.c b/src/wizard2.c
index 824bc724..f606fd72 100644
--- a/src/wizard2.c
+++ b/src/wizard2.c
@@ -1157,17 +1157,8 @@ static void do_cmd_wiz_play(void)
s = "You have nothing to play with.";
if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
- /* Get the item (in the pack) */
- if (item >= 0)
- {
- o_ptr = &p_ptr->inventory[item];
- }
-
- /* Get the item (on the floor) */
- else
- {
- o_ptr = &o_list[0 - item];
- }
+ /* Get the item */
+ o_ptr = get_object(item);
/* The item was not changed */