#include "monster/monster-info.h"
#include "monster/monster-status-setter.h"
#include "monster/monster-status.h"
+#include "monster/monster-util.h"
#include "monster/smart-learn-types.h"
#include "object-hook/hook-weapon.h"
#include "pet/pet-util.h"
return false;
}
- if (grid.m_idx) {
+ if (is_monster(grid.m_idx)) {
PlayerEnergy(player_ptr).set_player_turn_energy(100);
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
const auto *m_ptr = &player_ptr->current_floor_ptr->m_list[grid.m_idx];
- if (!grid.m_idx || !m_ptr->ml) {
+ if (!is_monster(grid.m_idx) || !m_ptr->ml) {
msg_print(_("その場所にはモンスターはいません。", "There is no monster here."));
return false;
}
target_pet = old_target_pet;
auto &floor = *player_ptr->current_floor_ptr;
const auto &grid = floor.grid_array[target_row][target_col];
- if (grid.m_idx == 0) {
+ if (!is_monster(grid.m_idx)) {
return;
}
player_ptr->pet_t_m_idx = 0;
} else {
auto *g_ptr = &player_ptr->current_floor_ptr->grid_array[target_row][target_col];
- if (g_ptr->m_idx && (player_ptr->current_floor_ptr->m_list[g_ptr->m_idx].ml)) {
+ if (is_monster(g_ptr->m_idx) && (player_ptr->current_floor_ptr->m_list[g_ptr->m_idx].ml)) {
player_ptr->pet_t_m_idx = player_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx;
player_ptr->pet_follow_distance = PET_DESTROY_DIST;
} else {