OSDN Git Service

[Fix] #38997 cmd-pet.c/cmd-read.c 内変数参照修正. / Fix variable references in cmd-pet.c...
authordeskull <deskull@users.sourceforge.jp>
Sat, 4 Jan 2020 06:52:06 +0000 (15:52 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sat, 4 Jan 2020 06:52:06 +0000 (15:52 +0900)
src/cmd/cmd-pet.c
src/cmd/cmd-read.c

index 4ea6cb7..8ab733c 100644 (file)
@@ -82,12 +82,12 @@ PERCENTAGE calculate_upkeep(player_type *creature_ptr)
 
        total_friends = 0;
 
-       for (m_idx = p_ptr->current_floor_ptr->m_max - 1; m_idx >= 1; m_idx--)
+       for (m_idx = creature_ptr->current_floor_ptr->m_max - 1; m_idx >= 1; m_idx--)
        {
                monster_type *m_ptr;
                monster_race *r_ptr;
 
-               m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
+               m_ptr = &creature_ptr->current_floor_ptr->m_list[m_idx];
                if (!monster_is_valid(m_ptr)) continue;
                r_ptr = &r_info[m_ptr->r_idx];
 
@@ -972,7 +972,7 @@ bool rakuba(player_type *creature_ptr, HIT_POINT dam, bool force)
        POSITION y, x, oy, ox, sy = 0, sx = 0;
        int sn = 0;
        GAME_TEXT m_name[MAX_NLEN];
-       monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[creature_ptr->riding];
+       monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[creature_ptr->riding];
        monster_race *r_ptr = &r_info[m_ptr->r_idx];
        bool fall_dam = FALSE;
 
@@ -1022,7 +1022,7 @@ bool rakuba(player_type *creature_ptr, HIT_POINT dam, bool force)
                        y = creature_ptr->y + ddy_ddd[i];
                        x = creature_ptr->x + ddx_ddd[i];
 
-                       g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
+                       g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
 
                        if (g_ptr->m_idx) continue;
 
index a24f17d..f589fd2 100644 (file)
@@ -617,7 +617,7 @@ void do_cmd_read_scroll(player_type *creature_ptr)
        q = _("どの巻物を読みますか? ", "Read which scroll? ");
        s = _("読める巻物がない。", "You have no scrolls to read.");
 
-       o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
+       o_ptr = choose_object(creature_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
        if (!o_ptr) return;
 
        /* Read the scroll */