OSDN Git Service

[Refactor] monster_name() で一部 cmd2.c の投擲対象処理を整理。
[hengband/hengband.git] / src / cmd-item.c
index 82aa664..7dc6d1e 100644 (file)
@@ -27,6 +27,7 @@
 #include "artifact.h"
 #include "avatar.h"
 #include "player-status.h"
+#include "monster.h"
 
 
 /*!
@@ -1377,9 +1378,7 @@ void do_cmd_query_symbol(void)
        /* Nothing to recall */
        if (!n)
        {
-               /* Free the "who" array */
-               C_KILL(who, max_r_idx, IDX);
-
+               C_KILL(who, max_r_idx, MONRACE_IDX);
                return;
        }
 
@@ -1392,12 +1391,8 @@ void do_cmd_query_symbol(void)
 
        why = 2;
 
-       /* Select the sort method */
-       ang_sort_comp = ang_sort_comp_hook;
-       ang_sort_swap = ang_sort_swap_hook;
-
        /* Sort the array */
-       ang_sort(who, &why, n);
+       ang_sort(who, &why, n, ang_sort_comp_hook, ang_sort_swap_hook);
 
        /* Sort by kills (and level) */
        if (query == 'k')
@@ -1409,21 +1404,14 @@ void do_cmd_query_symbol(void)
        /* Catch "escape" */
        if (query != 'y')
        {
-               /* Free the "who" array */
-               C_KILL(who, max_r_idx, IDX);
-
+               C_KILL(who, max_r_idx, MONRACE_IDX);
                return;
        }
 
        /* Sort if needed */
        if (why == 4)
        {
-               /* Select the sort method */
-               ang_sort_comp = ang_sort_comp_hook;
-               ang_sort_swap = ang_sort_swap_hook;
-
-               /* Sort the array */
-               ang_sort(who, &why, n);
+               ang_sort(who, &why, n, ang_sort_comp_hook, ang_sort_swap_hook);
        }