OSDN Git Service

[Refactor] #37353 monster_is_valid() 関数を定義し単純な !r_idx の条件から置換。 / Define monster_is_va...
[hengbandforosx/hengbandosx.git] / src / wizard2.c
index 592589f..1313f4c 100644 (file)
@@ -27,6 +27,7 @@
 #include "spells-floor.h"
 
 #include "object-hook.h"
+#include "monster-status.h"
 
 #ifdef ALLOW_WIZARD
 
@@ -1475,7 +1476,7 @@ static void do_cmd_wiz_zap(void)
                monster_type *m_ptr = &current_floor_ptr->m_list[i];
 
                /* Paranoia -- Skip dead monsters */
-               if (!m_ptr->r_idx) continue;
+               if (!monster_is_valid(m_ptr)) continue;
 
                /* Skip the mount */
                if (i == p_ptr->riding) continue;
@@ -1512,7 +1513,7 @@ static void do_cmd_wiz_zap_all(void)
                monster_type *m_ptr = &current_floor_ptr->m_list[i];
 
                /* Paranoia -- Skip dead monsters */
-               if (!m_ptr->r_idx) continue;
+               if (!monster_is_valid(m_ptr)) continue;
 
                /* Skip the mount */
                if (i == p_ptr->riding) continue;