OSDN Git Service

[Refactor] #38997 rustproof() に player_type * 引数を追加. / Add player_type * argument...
authordeskull <deskull@users.sourceforge.jp>
Sat, 4 Jan 2020 08:16:06 +0000 (17:16 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sat, 4 Jan 2020 08:16:06 +0000 (17:16 +0900)
src/realm-nature.c
src/spells-object.c
src/spells-object.h

index bd2da45..cf78b15 100644 (file)
@@ -424,7 +424,7 @@ concptr do_nature_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
                {
                        if (cast)
                        {
-                               if (!rustproof()) return NULL;
+                               if (!rustproof(caster_ptr)) return NULL;
                        }
                }
                break;
index d665f32..9621390 100644 (file)
@@ -700,7 +700,7 @@ bool curse_weapon(bool force, int slot)
  * @brief 防具の錆止め防止処理
  * @return ターン消費を要する処理を行ったならばTRUEを返す
  */
-bool rustproof(void)
+bool rustproof(player_type *caster_ptr)
 {
        OBJECT_IDX item;
        object_type *o_ptr;
@@ -713,7 +713,7 @@ bool rustproof(void)
        q = _("どの防具に錆止めをしますか?", "Rustproof which piece of armour? ");
        s = _("錆止めできるものがありません。", "You have nothing to rustproof.");
 
-       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;
 
        object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
@@ -737,7 +737,7 @@ bool rustproof(void)
        msg_format("%s %s %s now protected against corrosion.", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "are" : "is"));
 #endif
 
-       calc_android_exp(p_ptr);
+       calc_android_exp(caster_ptr);
        return TRUE;
 }
 
index d5032a9..e99a79a 100644 (file)
@@ -8,7 +8,7 @@ extern void acquire_chaos_weapon(player_type *creature_ptr);
 extern bool curse_armor(player_type *owner_ptr);
 extern bool curse_weapon_object(player_type *creature_ptr, bool force, object_type *o_ptr);
 extern bool curse_weapon(bool force, int slot);
-extern bool rustproof(void);
+extern bool rustproof(player_type *caster_ptr);
 extern bool brand_bolts(void);
 extern bool perilous_secrets(player_type *user_ptr);
 extern void get_bloody_moon_flags(object_type *o_ptr);