OSDN Git Service

[Fix] #38997 cmd-zaprod.c/cmd-zapwand.c 内変数参照修正. / Fix variable references in cmd...
authordeskull <deskull@users.sourceforge.jp>
Sat, 4 Jan 2020 07:45:21 +0000 (16:45 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sat, 4 Jan 2020 07:45:21 +0000 (16:45 +0900)
src/cmd/cmd-zaprod.c
src/cmd/cmd-zapwand.c

index 3bcf7a8..9be52a5 100644 (file)
@@ -281,7 +281,7 @@ void exe_zap_rod(player_type *creature_ptr, INVENTORY_IDX item)
 
        object_kind *k_ptr;
 
-       o_ptr = REF_ITEM(creature_ptr, p_ptr->current_floor_ptr, item);
+       o_ptr = REF_ITEM(creature_ptr, creature_ptr->current_floor_ptr, item);
 
        /* Mega-Hack -- refuse to zap a pile from the ground */
        if ((item < 0) && (o_ptr->number > 1))
@@ -408,7 +408,7 @@ void do_cmd_zap_rod(player_type *creature_ptr)
        q = _("どのロッドを振りますか? ", "Zap which rod? ");
        s = _("使えるロッドがない。", "You have no rod to zap.");
 
-       if (!choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), TV_ROD)) return;
+       if (!choose_object(creature_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), TV_ROD)) return;
 
        /* Zap the rod */
        exe_zap_rod(creature_ptr, item);
index 5b4d486..9d02f84 100644 (file)
@@ -335,7 +335,7 @@ void exe_aim_wand(player_type *creature_ptr, INVENTORY_IDX item)
        object_type *o_ptr;
        bool old_target_pet = target_pet;
 
-       o_ptr = REF_ITEM(creature_ptr, p_ptr->current_floor_ptr, item);
+       o_ptr = REF_ITEM(creature_ptr, creature_ptr->current_floor_ptr, item);
 
        /* Mega-Hack -- refuse to aim a pile from the ground */
        if ((item < 0) && (o_ptr->number > 1))
@@ -459,7 +459,7 @@ void do_cmd_aim_wand(player_type *creature_ptr)
 
        q = _("どの魔法棒で狙いますか? ", "Aim which wand? ");
        s = _("使える魔法棒がない。", "You have no wand to aim.");
-       if (!choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), TV_WAND)) return;
+       if (!choose_object(creature_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), TV_WAND)) return;
 
        exe_aim_wand(creature_ptr, item);
 }