OSDN Git Service

[Refactor] #38997 bress_weapon() に player_type * 引数を追加. / Add player_type * argument...
authordeskull <deskull@users.sourceforge.jp>
Sun, 15 Dec 2019 16:17:59 +0000 (01:17 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sun, 15 Dec 2019 16:17:59 +0000 (01:17 +0900)
src/racial.c
src/spells-object.c
src/spells-object.h

index f7e61c1..ccc0e4c 100644 (file)
@@ -415,7 +415,7 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
                {
                        if (is_good_realm(creature_ptr->realm1))
                        {
-                               if (!bless_weapon()) return FALSE;
+                               if (!bless_weapon(creature_ptr)) return FALSE;
                        }
                        else
                        {
index 3fe2223..e89d2c7 100644 (file)
@@ -913,7 +913,7 @@ void phlogiston(player_type *caster_ptr)
  * Bless a weapon
  * @return ターン消費を要する処理を行ったならばTRUEを返す
  */
-bool bless_weapon(void)
+bool bless_weapon(player_type *caster_ptr)
 {
        OBJECT_IDX item;
        object_type *o_ptr;
@@ -927,7 +927,7 @@ bool bless_weapon(void)
        q = _("どのアイテムを祝福しますか?", "Bless which weapon? ");
        s = _("祝福できる武器がありません。", "You have weapon to bless.");
 
-       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));
@@ -962,8 +962,8 @@ bool bless_weapon(void)
                o_ptr->feeling = FEEL_NONE;
 
                /* Recalculate the bonuses */
-               p_ptr->update |= (PU_BONUS);
-               p_ptr->window |= (PW_EQUIP);
+               caster_ptr->update |= (PU_BONUS);
+               caster_ptr->window |= (PW_EQUIP);
        }
 
        /*
@@ -1046,9 +1046,9 @@ bool bless_weapon(void)
                }
        }
 
-       p_ptr->update |= (PU_BONUS);
-       p_ptr->window |= (PW_EQUIP | PW_PLAYER);
-       calc_android_exp(p_ptr);
+       caster_ptr->update |= (PU_BONUS);
+       caster_ptr->window |= (PW_EQUIP | PW_PLAYER);
+       calc_android_exp(caster_ptr);
 
        return TRUE;
 }
index d9ccd07..42c83d9 100644 (file)
@@ -13,7 +13,7 @@ extern bool brand_bolts(void);
 extern bool perilous_secrets(player_type *user_ptr);
 extern void get_bloody_moon_flags(object_type *o_ptr);
 extern void phlogiston(player_type *caster_ptr);
-extern bool bless_weapon(void);
+extern bool bless_weapon(player_type *caster_ptr);
 extern bool pulish_shield(void);
 
 /*