OSDN Git Service

[Refactor] #37353 型の置換。 / Type replacement.
authorDeskull <deskull@users.sourceforge.jp>
Sat, 17 Nov 2018 09:31:40 +0000 (18:31 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Sat, 17 Nov 2018 09:31:40 +0000 (18:31 +0900)
src/externs.h
src/floor-save.c
src/monster-process.c
src/spells3.c
src/z-virt.c

index 3745013..837d452 100644 (file)
@@ -1014,9 +1014,9 @@ extern bool psychometry(void);
 /* spells3.c */
 extern bool teleport_away(MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode);
 extern void teleport_monster_to(MONSTER_IDX m_idx, POSITION ty, POSITION tx, int power, BIT_FLAGS mode);
-extern bool teleport_player_aux(int dis, BIT_FLAGS mode);
-extern void teleport_player(int dis, BIT_FLAGS mode);
-extern void teleport_player_away(MONSTER_IDX m_idx, int dis);
+extern bool teleport_player_aux(POSITION dis, BIT_FLAGS mode);
+extern void teleport_player(POSITION dis, BIT_FLAGS mode);
+extern void teleport_player_away(MONSTER_IDX m_idx, POSITION dis);
 extern void teleport_player_to(POSITION ny, POSITION nx, BIT_FLAGS mode);
 extern void teleport_away_followable(MONSTER_IDX m_idx);
 extern void teleport_level(MONSTER_IDX m_idx);
index 49be5b8..1b306ca 100644 (file)
@@ -408,7 +408,7 @@ static void preserve_pet(void)
                        }
                        else
                        {
-                               int dis = distance(p_ptr->y, p_ptr->x, m_ptr->fy, m_ptr->fx);
+                               POSITION dis = distance(p_ptr->y, p_ptr->x, m_ptr->fy, m_ptr->fx);
 
                                /* Confused (etc.) monsters don't follow. */
                                if (MON_CONFUSED(m_ptr) || MON_STUNNED(m_ptr) || MON_CSLEEP(m_ptr)) continue;
@@ -681,7 +681,7 @@ static void update_unique_artifact(s16b cur_floor_id)
 static void get_out_monster(void)
 {
        int tries = 0;
-       int dis = 1;
+       POSITION dis = 1;
        int oy = p_ptr->y;
        int ox = p_ptr->x;
        MONSTER_IDX m_idx = cave[oy][ox].m_idx;
index 5b6f37f..4d15c89 100644 (file)
@@ -707,7 +707,7 @@ static bool get_fear_moves_aux(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
        /* Check nearby grids, diagonals first */
        for (i = 7; i >= 0; i--)
        {
-               int dis, s;
+               POSITION dis, s;
 
                /* Get the location */
                y = fy + ddy_ddd[i];
@@ -2605,7 +2605,7 @@ void process_monster(MONSTER_IDX m_idx)
                        if (avoid || lonely || distant)
                        {
                                /* Remember the leash length */
-                               int dis = p_ptr->pet_follow_distance;
+                               POSITION dis = p_ptr->pet_follow_distance;
 
                                /* Hack -- adjust follow distance temporarily */
                                if (p_ptr->pet_follow_distance > PET_SEEK_DIST)
index caf5088..833704e 100644 (file)
@@ -145,17 +145,18 @@ bool teleport_away(MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode)
  */
 void teleport_monster_to(MONSTER_IDX m_idx, POSITION ty, POSITION tx, int power, BIT_FLAGS mode)
 {
-       int ny, nx, oy, ox, d, i, min;
+       POSITION ny, nx, oy, ox;
+       int d, i, min;
        int attempts = 500;
-       int dis = 2;
+       POSITION dis = 2;
        bool look = TRUE;
        monster_type *m_ptr = &m_list[m_idx];
 
        /* Paranoia */
-       if (!m_ptr->r_idx) return;
+       if(!m_ptr->r_idx) return;
 
        /* "Skill" test */
-       if (randint1(100) > power) return;
+       if(randint1(100) > power) return;
 
        /* Initialize */
        ny = m_ptr->fy;
@@ -258,7 +259,7 @@ void teleport_monster_to(MONSTER_IDX m_idx, POSITION ty, POSITION tx, int power,
  * </pre>
  */
 
-bool teleport_player_aux(int dis, BIT_FLAGS mode)
+bool teleport_player_aux(POSITION dis, BIT_FLAGS mode)
 {
        int candidates_at[MAX_TELEPORT_DISTANCE + 1];
        int total_candidates, cur_candidates;
@@ -374,7 +375,7 @@ bool teleport_player_aux(int dis, BIT_FLAGS mode)
  * @param mode オプション
  * @return なし
  */
-void teleport_player(int dis, BIT_FLAGS mode)
+void teleport_player(POSITION dis, BIT_FLAGS mode)
 {
        int yy, xx;
 
@@ -418,7 +419,7 @@ void teleport_player(int dis, BIT_FLAGS mode)
  * @param dis テレポート距離
  * @return なし
  */
-void teleport_player_away(MONSTER_IDX m_idx, int dis)
+void teleport_player_away(MONSTER_IDX m_idx, POSITION dis)
 {
        int yy, xx;
 
@@ -472,7 +473,7 @@ void teleport_player_away(MONSTER_IDX m_idx, int dis)
 void teleport_player_to(POSITION ny, POSITION nx, BIT_FLAGS mode)
 {
        POSITION y, x;
-       int dis = 0, ctr = 0;
+       POSITION dis = 0, ctr = 0;
 
        if (p_ptr->anti_tele && !(mode & TELEPORT_NONMAGICAL))
        {
index 53f4f8f..9613fac 100644 (file)
 /* Purpose: Memory management routines -BEN- */
 
 #include "z-virt.h"
-
 #include "z-util.h"
 
-
 /*
  * Allow debugging messages to track memory usage.
  */