OSDN Git Service

[Refactor] #38997 #37353 forget_flow() に floor_type * 引数を追加して floor.c/h へ移動. / Add...
authordeskull <deskull@users.sourceforge.jp>
Tue, 12 Nov 2019 00:39:59 +0000 (09:39 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Tue, 12 Nov 2019 00:39:59 +0000 (09:39 +0900)
src/floor.c
src/floor.h
src/grid.c
src/grid.h
src/player-move.c
src/spells-floor.c

index e8b4753..06fc583 100644 (file)
@@ -169,3 +169,24 @@ void update_smell(floor_type *floor_ptr)
        }
 }
 
+
+/*
+ * Hack -- forget the "flow" information
+ */
+void forget_flow(floor_type *floor_ptr)
+{
+       POSITION x, y;
+
+       /* Check the entire dungeon */
+       for (y = 0; y < floor_ptr->height; y++)
+       {
+               for (x = 0; x < floor_ptr->width; x++)
+               {
+                       /* Forget the old data */
+                       floor_ptr->grid_array[y][x].dist = 0;
+                       floor_ptr->grid_array[y][x].cost = 0;
+                       floor_ptr->grid_array[y][x].when = 0;
+               }
+       }
+}
+
index bab979e..7111e0a 100644 (file)
@@ -376,3 +376,5 @@ extern void update_smell(floor_type *floor_ptr);
 
 extern void place_secret_door(floor_type *floor_ptr, POSITION y, POSITION x, int type);
 extern void place_locked_door(floor_type *floor_ptr, POSITION y, POSITION x);
+extern void forget_flow(floor_type *floor_ptr);
+
index 4761ea4..9bda7ac 100644 (file)
@@ -1503,27 +1503,6 @@ void delayed_visual_update(void)
 
 
 /*
- * Hack -- forget the "flow" information
- */
-void forget_flow(void)
-{
-       POSITION x, y;
-
-       /* Check the entire dungeon */
-       for (y = 0; y < p_ptr->current_floor_ptr->height; y++)
-       {
-               for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
-               {
-                       /* Forget the old data */
-                       p_ptr->current_floor_ptr->grid_array[y][x].dist = 0;
-                       p_ptr->current_floor_ptr->grid_array[y][x].cost = 0;
-                       p_ptr->current_floor_ptr->grid_array[y][x].when = 0;
-               }
-       }
-}
-
-
-/*
  * Hack - speed up the update_flow algorithm by only doing
  * it everytime the player moves out of LOS of the last
  * "way-point".
index d6a4cce..e3c2ffd 100644 (file)
@@ -413,7 +413,6 @@ extern void print_rel(SYMBOL_CODE c, TERM_COLOR a, TERM_LEN y, TERM_LEN x);
 extern void note_spot(POSITION y, POSITION x);
 extern void lite_spot(POSITION y, POSITION x);
 extern void delayed_visual_update(void);
-extern void forget_flow(void);
 extern void update_flow(void);
 extern void cave_set_feat(POSITION y, POSITION x, FEAT_IDX feat);
 extern FEAT_IDX conv_dungeon_feat(FEAT_IDX newfeat);
index 93bf1a3..aa3b15b 100644 (file)
@@ -650,7 +650,7 @@ bool move_player_effect(player_type *creature_ptr, POSITION ny, POSITION nx, BIT
 
                if (mpe_mode & MPE_FORGET_FLOW)
                {
-                       forget_flow();
+                       forget_flow(creature_ptr->current_floor_ptr);
 
                        creature_ptr->update |= (PU_UN_VIEW);
                        creature_ptr->redraw |= (PR_MAP);
index 3180886..181bf3e 100644 (file)
@@ -698,7 +698,7 @@ bool destroy_area(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION r, b
                        }
                }
 
-               forget_flow();
+               forget_flow(floor_ptr);
 
                /* Mega-Hack -- Forget the view and lite */
                p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);