OSDN Git Service

[Refactor] #38997 psychometry() に player_type * 引数を追加. / Add player_type * argument...
authordeskull <deskull@users.sourceforge.jp>
Sun, 15 Dec 2019 16:09:06 +0000 (01:09 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sun, 15 Dec 2019 16:09:06 +0000 (01:09 +0900)
src/mind.c
src/spells.h
src/spells2.c

index 5d6a385..7ff7f21 100644 (file)
@@ -1113,7 +1113,7 @@ static bool cast_mindcrafter_spell(player_type *caster_ptr, int spell)
        case 7:
                /* Psychometry */
                if (plev < 25)
-                       return psychometry();
+                       return psychometry(caster_ptr);
                else
                        return ident_spell(caster_ptr, FALSE);
        case 8:
index 7f75388..b0828e2 100644 (file)
@@ -258,7 +258,7 @@ extern void cast_shuffle(player_type *caster_ptr);
 extern void stop_mouth(void);
 extern bool_hack vampirism(player_type *caster_ptr);
 extern bool panic_hit(void);
-extern bool psychometry(void);
+extern bool psychometry(player_type *caster_ptr);
 extern bool draconian_breath(player_type *creature_ptr);
 extern bool android_inside_weapon(player_type *creature_ptr);
 extern bool create_ration(player_type *crature_ptr);
index bc2ba35..a2763eb 100644 (file)
@@ -3928,7 +3928,7 @@ bool panic_hit(void)
 }
 
 /*!
-* @brief 超能力者のサイコメトリー処理/ Forcibly pseudo-identify an object in the p_ptr->inventory_list (or on the floor)
+* @brief 超能力者のサイコメトリー処理/ Forcibly pseudo-identify an object in the inventory (or on the floor)
 * @return なし
 * @note
 * currently this function allows pseudo-id of any object,
@@ -3939,7 +3939,7 @@ bool panic_hit(void)
 * good (Cure Light Wounds, Restore Strength, etc) or
 * bad (Poison, Weakness etc) or 'useless' (Slime Mold Juice, etc).
 */
-bool psychometry(void)
+bool psychometry(player_type *caster_ptr)
 {
        OBJECT_IDX      item;
        object_type *o_ptr;
@@ -3951,7 +3951,7 @@ bool psychometry(void)
        q = _("どのアイテムを調べますか?", "Meditate on which item? ");
        s = _("調べるアイテムがありません。", "You have nothing appropriate.");
 
-       o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
+       o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
        if (!o_ptr) return (FALSE);
 
        /* It is fully known, no information needed */
@@ -3986,8 +3986,8 @@ bool psychometry(void)
        o_ptr->feeling = feel;
        o_ptr->marked |= OM_TOUCHED;
 
-       p_ptr->update |= (PU_COMBINE | PU_REORDER);
-       p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
+       caster_ptr->update |= (PU_COMBINE | PU_REORDER);
+       caster_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
 
        /* Valid "tval" codes */
        switch (o_ptr->tval)