OSDN Git Service

[Refactor] #38997 day_break() に floor_type * 引数を追加.
authordeskull <deskull@users.sourceforge.jp>
Tue, 20 Aug 2019 11:49:36 +0000 (20:49 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Tue, 20 Aug 2019 11:49:36 +0000 (20:49 +0900)
src/core.c
src/floor-events.c
src/floor-events.h

index 2463182..2da730e 100644 (file)
@@ -3208,7 +3208,7 @@ static void process_world(void)
                        /* Check for dawn */
                        dawn = (!(current_world_ptr->game_turn % (TURNS_PER_TICK * TOWN_DAWN)));
 
-                       if (dawn) day_break();
+                       if (dawn) day_break(current_floor_ptr);
                        else night_falls(current_floor_ptr);
 
                }
index a720f93..a3f3df2 100644 (file)
@@ -20,7 +20,7 @@
 static bool mon_invis;
 static POSITION mon_fy, mon_fx;
 
-void day_break()
+void day_break(floor_type *floor_ptr)
 {
        POSITION y, x;
        msg_print(_("夜が明けた。", "The sun has risen."));
@@ -28,11 +28,11 @@ void day_break()
        if (!p_ptr->wild_mode)
        {
                /* Hack -- Scan the town */
-               for (y = 0; y < current_floor_ptr->height; y++)
+               for (y = 0; y < floor_ptr->height; y++)
                {
-                       for (x = 0; x < current_floor_ptr->width; x++)
+                       for (x = 0; x < floor_ptr->width; x++)
                        {
-                               grid_type *g_ptr = &current_floor_ptr->grid_array[y][x];
+                               grid_type *g_ptr = &floor_ptr->grid_array[y][x];
 
                                /* Assume lit */
                                g_ptr->info |= (CAVE_GLOW);
@@ -51,7 +51,7 @@ void day_break()
 
        if (p_ptr->special_defense & NINJA_S_STEALTH)
        {
-               if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(p_ptr, FALSE);
+               if (floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(p_ptr, FALSE);
        }
 
 }
index ea42d15..c008eb9 100644 (file)
@@ -1,5 +1,5 @@
 
-extern void day_break(void);
+extern void day_break(floor_type *floor_ptr);
 extern void night_falls(floor_type *floor_ptr);
 extern MONSTER_NUMBER count_all_hostile_monsters(floor_type *floor_ptr);
 extern byte get_dungeon_feeling(floor_type *floor_ptr);