From 518c5ffcdbedf9ae99fcf2011f54e96d18ec8de7 Mon Sep 17 00:00:00 2001 From: deskull Date: Mon, 13 May 2019 22:41:31 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#37353=20item=5Ftester=5Ftval=20?= =?utf8?q?=E3=82=92=20object1.c/object.h=20=E3=81=B8=E7=A7=BB=E5=8B=95?= =?utf8?q?=EF=BC=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/externs.h | 1 - src/object.h | 1 + src/object1.c | 6 ++++++ src/variable.c | 7 ------- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/externs.h b/src/externs.h index f42d3e83b..6f58eeec6 100644 --- a/src/externs.h +++ b/src/externs.h @@ -97,7 +97,6 @@ extern u32b saved_floor_file_sign; extern concptr keymap_act[KEYMAP_MODES][256]; extern player_type *p_ptr; -extern OBJECT_TYPE_VALUE item_tester_tval; extern bool (*get_obj_num_hook)(KIND_OBJECT_IDX k_idx); extern int highscore_fd; diff --git a/src/object.h b/src/object.h index c7bb17b1c..6ef6f76e8 100644 --- a/src/object.h +++ b/src/object.h @@ -87,6 +87,7 @@ struct object_type }; extern bool(*item_tester_hook)(object_type *o_ptr); +extern OBJECT_TYPE_VALUE item_tester_tval; /* object1.c */ extern ITEM_NUMBER scan_floor(OBJECT_IDX *items, POSITION y, POSITION x, BIT_FLAGS mode); diff --git a/src/object1.c b/src/object1.c index ae735defa..bb79772ab 100644 --- a/src/object1.c +++ b/src/object1.c @@ -1583,6 +1583,12 @@ bool check_book_realm(const OBJECT_TYPE_VALUE book_tval, const OBJECT_SUBTYPE_VA */ bool(*item_tester_hook)(object_type*); +/* + * Here is a "pseudo-hook" used during calls to "get_item()" and + * "show_inven()" and "show_equip()", and the choice window routines. + */ +OBJECT_TYPE_VALUE item_tester_tval; + /*! * @brief アイテムがitem_tester_hookグローバル関数ポインタの条件を満たしているかを返す汎用関数 * Check an item against the item tester info diff --git a/src/variable.c b/src/variable.c index ddbe0c891..ea2d63a89 100644 --- a/src/variable.c +++ b/src/variable.c @@ -129,13 +129,6 @@ player_type p_body; */ player_type *p_ptr = &p_body; - -/* - * Here is a "pseudo-hook" used during calls to "get_item()" and - * "show_inven()" and "show_equip()", and the choice window routines. - */ -OBJECT_TYPE_VALUE item_tester_tval; - /* * Hack -- function hook to restrict "get_obj_num_prep()" function */ -- 2.11.0