OSDN Git Service

[Fix] #38997 do_cmd_pet_dismiss() 内変数参照修正. / Fix variable references in do_cmd_pet_di...
authordeskull <deskull@users.sourceforge.jp>
Tue, 3 Dec 2019 09:56:11 +0000 (18:56 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Tue, 3 Dec 2019 09:56:11 +0000 (18:56 +0900)
src/cmd/cmd-pet.c

index 22cb06c..905b2ee 100644 (file)
@@ -153,9 +153,9 @@ void do_cmd_pet_dismiss(player_type *creature_ptr)
        C_MAKE(who, current_world_ptr->max_m_idx, MONSTER_IDX);
 
        /* Process the monsters (backwards) */
-       for (pet_ctr = p_ptr->current_floor_ptr->m_max - 1; pet_ctr >= 1; pet_ctr--)
+       for (pet_ctr = creature_ptr->current_floor_ptr->m_max - 1; pet_ctr >= 1; pet_ctr--)
        {
-               if (is_pet(&p_ptr->current_floor_ptr->m_list[pet_ctr]))
+               if (is_pet(&creature_ptr->current_floor_ptr->m_list[pet_ctr]))
                        who[max_pet++] = pet_ctr;
        }
 
@@ -169,7 +169,7 @@ void do_cmd_pet_dismiss(player_type *creature_ptr)
                bool kakunin;
 
                pet_ctr = who[i];
-               m_ptr = &p_ptr->current_floor_ptr->m_list[pet_ctr];
+               m_ptr = &creature_ptr->current_floor_ptr->m_list[pet_ctr];
 
                delete_this = FALSE;
                kakunin = ((pet_ctr == creature_ptr->riding) || (m_ptr->nickname));