OSDN Git Service

[Refactor] #37353 item_tester_refill_torch() to object_can_refill_torch() in melee1.c.
authordeskull <deskull@users.sourceforge.jp>
Mon, 4 Mar 2019 14:07:50 +0000 (23:07 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Mon, 4 Mar 2019 14:07:50 +0000 (23:07 +0900)
src/cmd-item.c
src/object-hook.c
src/object-hook.h

index c99389a..72efe4d 100644 (file)
@@ -1002,24 +1002,6 @@ static void do_cmd_refill_lamp(void)
        p_ptr->update |= (PU_TORCH);
 }
 
-
-/*!
- * @brief オブジェクトが松明に束ねられるかどうかを判定する
- * An "item_tester_hook" for refilling torches
- * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
- * @return オブジェクトが松明に束ねられるならばTRUEを返す
- */
-static bool item_tester_refill_torch(object_type *o_ptr)
-{
-       /* Torches are okay */
-       if ((o_ptr->tval == TV_LITE) &&
-           (o_ptr->sval == SV_LITE_TORCH)) return (TRUE);
-
-       /* Assume not okay */
-       return (FALSE);
-}
-
-
 /*!
  * @brief 松明を束ねるコマンドのメインルーチン
  * Refuel the players torch (from the pack or floor)
@@ -1035,7 +1017,7 @@ static void do_cmd_refill_torch(void)
        concptr q, s;
 
        /* Restrict the choices */
-       item_tester_hook = item_tester_refill_torch;
+       item_tester_hook = object_can_refill_torch;
 
        q = _("どの松明で明かりを強めますか? ", "Refuel with which torch? ");
        s = _("他に松明がない。", "You have no extra torches.");
index 7e6cfec..14ee7e2 100644 (file)
@@ -882,7 +882,6 @@ bool object_is_nameless(object_type *o_ptr)
        return FALSE;
 }
 
-
 /*!
  * @brief オブジェクトが両手持ち可能な武器かを返す /
  * Check if an object is melee weapon and allows wielding with two-hands
@@ -895,3 +894,20 @@ bool object_allow_two_hands_wielding(object_type *o_ptr)
 
        return FALSE;
 }
+
+/*!
+ * @brief オブジェクトが松明に束ねられるかどうかを判定する
+ * An "item_tester_hook" for refilling torches
+ * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
+ * @return オブジェクトが松明に束ねられるならばTRUEを返す
+ */
+bool object_can_refill_torch(object_type *o_ptr)
+{
+       /* Torches are okay */
+       if ((o_ptr->tval == TV_LITE) &&
+               (o_ptr->sval == SV_LITE_TORCH)) return (TRUE);
+
+       /* Assume not okay */
+       return (FALSE);
+}
+
index 9e7ca50..fb811ed 100644 (file)
@@ -46,4 +46,5 @@ extern bool object_is_smith(object_type *o_ptr);
 extern bool object_is_artifact(object_type *o_ptr);
 extern bool object_is_random_artifact(object_type *o_ptr);
 extern bool object_is_nameless(object_type *o_ptr);
-extern bool object_allow_two_hands_wielding(object_type *o_ptr);
\ No newline at end of file
+extern bool object_allow_two_hands_wielding(object_type *o_ptr);
+extern bool object_can_refill_torch(object_type *o_ptr);