OSDN Git Service

[modify](2.2.1.1 #37582) GF_OLD_DRAINをGF_HYPODYNAMIAに改名。使い手のHP回復や滋養度回復を伴わない同魔法効果を...
[hengband/hengband.git] / src / xtra2.c
index 8716cba..3011542 100644 (file)
@@ -481,7 +481,7 @@ void check_quest_completion(monster_type *m_ptr)
        {
                int i;
 
-               for (i = max_quests - 1; i > 0; i--)
+               for (i = max_q_idx - 1; i > 0; i--)
                {
                        quest_type* const q_ptr = &quest[i];
                        
@@ -680,7 +680,7 @@ void check_find_art_quest_completion(object_type *o_ptr)
 {
        int i;
        /* Check if completed a quest */
-       for (i = 0; i < max_quests; i++)
+       for (i = 0; i < max_q_idx; i++)
        {
                if ((quest[i].type == QUEST_TYPE_FIND_ARTIFACT) &&
                    (quest[i].status == QUEST_STATUS_TAKEN) &&
@@ -2720,13 +2720,11 @@ static void ang_sort_swap_distance(vptr u, vptr v, int a, int b)
 /*
  * Hack -- help "select" a location (see below)
  */
-static s16b target_pick(POSITION y1, POSITION x1, POSITION dy, POSITION dx)
+static POSITION_IDX target_pick(POSITION y1, POSITION x1, POSITION dy, POSITION dx)
 {
-       int i, v;
-
-       int x2, y2, x3, y3, x4, y4;
-
-       int b_i = -1, b_v = 9999;
+       POSITION_IDX i, v;
+       POSITION x2, y2, x3, y3, x4, y4;
+       POSITION_IDX b_i = -1, b_v = 9999;
 
 
        /* Scan the locations */
@@ -2998,7 +2996,7 @@ bool show_gold_on_floor = FALSE;
  *
  * This function must handle blindness/hallucination.
  */
-static int target_set_aux(int y, int x, BIT_FLAGS mode, cptr info)
+static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, cptr info)
 {
        cave_type *c_ptr = &cave[y][x];
        s16b this_o_idx, next_o_idx = 0;
@@ -3006,7 +3004,7 @@ static int target_set_aux(int y, int x, BIT_FLAGS mode, cptr info)
        bool boring = TRUE;
        s16b feat;
        feature_type *f_ptr;
-       int query = '\001';
+       char query = '\001';
        char out_val[MAX_NLEN+80];
 
 #ifdef ALLOW_EASY_FLOOR
@@ -3512,9 +3510,9 @@ static int target_set_aux(int y, int x, BIT_FLAGS mode, cptr info)
                        if (c_ptr->mimic) sprintf(f_idx_str, "%d/%d", c_ptr->feat, c_ptr->mimic);
                        else sprintf(f_idx_str, "%d", c_ptr->feat);
 #ifdef JP
-                       sprintf(out_val, "%s%s%s%s[%s] %x %s %d %d %d (%d,%d) %d", s1, name, s2, s3, info, c_ptr->info, f_idx_str, c_ptr->dist, c_ptr->cost, c_ptr->when, y, x, travel.cost[y][x]);
+                       sprintf(out_val, "%s%s%s%s[%s] %x %s %d %d %d (%d,%d) %d", s1, name, s2, s3, info, (unsigned int)c_ptr->info, f_idx_str, c_ptr->dist, c_ptr->cost, c_ptr->when, (int)y, (int)x, travel.cost[y][x]);
 #else
-                       sprintf(out_val, "%s%s%s%s [%s] %x %s %d %d %d (%d,%d)", s1, s2, s3, name, info, c_ptr->info, f_idx_str, c_ptr->dist, c_ptr->cost, c_ptr->when, y, x);
+                       sprintf(out_val, "%s%s%s%s [%s] %x %s %d %d %d (%d,%d)", s1, s2, s3, name, info, c_ptr->info, f_idx_str, c_ptr->dist, c_ptr->cost, c_ptr->when, (int)y, (int)x);
 #endif
                }
                else
@@ -4093,6 +4091,7 @@ bool get_aim_dir(DIRECTION *dp)
        DIRECTION dir;
        char    command;
        cptr    p;
+       COMMAND_CODE code;
 
        /* Initialize */
        (*dp) = 0;
@@ -4105,17 +4104,18 @@ bool get_aim_dir(DIRECTION *dp)
 
 #ifdef ALLOW_REPEAT /* TNB */
 
-       if (repeat_pull(dp))
+       if (repeat_pull(&code))
        {
                /* Confusion? */
 
                /* Verify */
-               if (!(*dp == 5 && !target_okay()))
+               if (!(code == 5 && !target_okay()))
                {
 /*                     return (TRUE); */
-                       dir = *dp;
+                       dir = (DIRECTION)code;
                }
        }
+       *dp = (DIRECTION)code;
 
 #endif /* ALLOW_REPEAT -- TNB */
 
@@ -4210,7 +4210,7 @@ bool get_aim_dir(DIRECTION *dp)
 #ifdef ALLOW_REPEAT /* TNB */
 
 /*     repeat_push(dir); */
-       repeat_push(command_dir);
+       repeat_push((COMMAND_CODE)command_dir);
 
 #endif /* ALLOW_REPEAT -- TNB */
 
@@ -4240,6 +4240,7 @@ bool get_rep_dir(DIRECTION *dp, bool under)
 {
        DIRECTION dir;
        cptr prompt;
+       COMMAND_CODE code;
 
        /* Initialize */
        (*dp) = 0;
@@ -4249,11 +4250,12 @@ bool get_rep_dir(DIRECTION *dp, bool under)
 
 #ifdef ALLOW_REPEAT /* TNB */
 
-       if (repeat_pull(dp))
+       if (repeat_pull(&code))
        {
-               dir = *dp;
+               dir = (DIRECTION)code;
 /*             return (TRUE); */
        }
+       *dp = (DIRECTION)code;
 
 #endif /* ALLOW_REPEAT -- TNB */
 
@@ -4365,7 +4367,7 @@ bool get_rep_dir(DIRECTION *dp, bool under)
 #ifdef ALLOW_REPEAT /* TNB */
 
 /*     repeat_push(dir); */
-       repeat_push(command_dir);
+       repeat_push((COMMAND_CODE)command_dir);
 
 #endif /* ALLOW_REPEAT -- TNB */
 
@@ -4377,6 +4379,7 @@ bool get_rep_dir(DIRECTION *dp, bool under)
 bool get_rep_dir2(DIRECTION *dp)
 {
        DIRECTION dir;
+       COMMAND_CODE code;
 
        /* Initialize */
        (*dp) = 0;
@@ -4386,11 +4389,12 @@ bool get_rep_dir2(DIRECTION *dp)
 
 #ifdef ALLOW_REPEAT /* TNB */
 
-       if (repeat_pull(dp))
+       if (repeat_pull(&code))
        {
-               dir = *dp;
+               dir = (DIRECTION)code;
 /*             return (TRUE); */
        }
+       *dp = (DIRECTION)code;
 
 #endif /* ALLOW_REPEAT -- TNB */
 
@@ -4442,7 +4446,7 @@ bool get_rep_dir2(DIRECTION *dp)
 #ifdef ALLOW_REPEAT /* TNB */
 
 /*     repeat_push(dir); */
-       repeat_push(command_dir);
+       repeat_push((COMMAND_CODE)command_dir);
 
 #endif /* ALLOW_REPEAT -- TNB */