OSDN Git Service

[Refactor] #38997 floor-events.c の引数をplayer_type * に統一 / Unified argument of floor...
authorHourier <hourier@users.sourceforge.jp>
Sun, 12 Jan 2020 15:50:59 +0000 (00:50 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sun, 12 Jan 2020 16:14:52 +0000 (01:14 +0900)
src/core.c
src/floor-events.c
src/floor-events.h
src/player-status.c

index bf24eb4..922e29a 100644 (file)
@@ -3107,7 +3107,7 @@ static void process_world(player_type *player_ptr)
        extract_day_hour_min(&day, &hour, &min);
 
        /* Update dungeon feeling, and announce it if changed */
-       update_dungeon_feeling(player_ptr, player_ptr->current_floor_ptr);
+       update_dungeon_feeling(player_ptr);
 
        /* 帰還無しモード時のレベルテレポバグ対策 / Fix for level teleport bugs on ironman_downward.*/
        if (ironman_downward && (player_ptr->dungeon_idx != DUNGEON_ANGBAND && player_ptr->dungeon_idx != 0))
index 784ab91..0e93566 100644 (file)
@@ -275,13 +275,14 @@ byte get_dungeon_feeling(floor_type *floor_ptr)
  * / Update dungeon feeling, and announce it if changed
  * @return なし
  */
-void update_dungeon_feeling(player_type *subject_ptr, floor_type *floor_ptr)
+void update_dungeon_feeling(player_type *subject_ptr)
 {
        byte new_feeling;
        int quest_num;
        int delay;
 
        /* No feeling on the surface */
+       floor_type *floor_ptr = subject_ptr->current_floor_ptr;
        if (!floor_ptr->dun_level) return;
 
        /* No feeling in the arena */
@@ -418,7 +419,7 @@ void forget_lite(floor_type *floor_ptr)
  *                 ***         *****
  *                              ***
  */
-void update_lite(player_type *subject_ptr, floor_type *floor_ptr)
+void update_lite(player_type *subject_ptr)
 {
        int i;
        POSITION x, y, min_x, max_x, min_y, max_y;
@@ -442,6 +443,7 @@ void update_lite(player_type *subject_ptr, floor_type *floor_ptr)
        /*** Save the old "lite" grids for later ***/
 
        /* Clear them all */
+       floor_type *floor_ptr = subject_ptr->current_floor_ptr;
        for (i = 0; i < floor_ptr->lite_n; i++)
        {
                y = floor_ptr->lite_y[i];
@@ -1494,7 +1496,7 @@ static void mon_dark_hack(player_type *subject_ptr, POSITION y, POSITION x)
  * updating.  Only squares in view of the player, whos state
  * changes are drawn via lite_spot().
  */
-void update_mon_lite(player_type *subject_ptr, floor_type *floor_ptr)
+void update_mon_lite(player_type *subject_ptr)
 {
        int i, rad;
        grid_type *g_ptr;
@@ -1510,6 +1512,7 @@ void update_mon_lite(player_type *subject_ptr, floor_type *floor_ptr)
                (MAX_SIGHT / 2 + 1) : (MAX_SIGHT + 3);
 
        /* Clear all monster lit squares */
+       floor_type *floor_ptr = subject_ptr->current_floor_ptr;
        for (i = 0; i < floor_ptr->mon_lite_n; i++)
        {
                /* Point to grid */
index d2d0a94..56bd80e 100644 (file)
@@ -4,11 +4,11 @@ extern void day_break(player_type *subject_ptr);
 extern void night_falls(player_type *subject_ptr);
 extern MONSTER_NUMBER count_all_hostile_monsters(floor_type *floor_ptr);
 extern byte get_dungeon_feeling(floor_type *floor_ptr);
-extern void update_dungeon_feeling(player_type *subject_ptr, floor_type *floor_ptr);
+extern void update_dungeon_feeling(player_type *subject_ptr);
 extern void glow_deep_lava_and_bldg(player_type *subject_ptr);
 extern void forget_lite(floor_type *floor_ptr);
-extern void update_lite(player_type *subject_ptr, floor_type *floor_ptr);
+extern void update_lite(player_type *subject_ptr);
 extern void forget_view(floor_type *floor_ptr);
 extern void update_view(player_type *subject_ptr, floor_type *floor_ptr);
-extern void update_mon_lite(player_type *subject_ptr, floor_type *floor_ptr);
+extern void update_mon_lite(player_type *subject_ptr);
 extern void clear_mon_lite(floor_type *floor_ptr);
index 7491d6a..c4ef52a 100644 (file)
@@ -5065,7 +5065,7 @@ void update_creature(player_type *creature_ptr)
        if (creature_ptr->update & (PU_LITE))
        {
                creature_ptr->update &= ~(PU_LITE);
-               update_lite(creature_ptr, floor_ptr);
+               update_lite(creature_ptr);
        }
 
        if (creature_ptr->update & (PU_FLOW))
@@ -5087,7 +5087,7 @@ void update_creature(player_type *creature_ptr)
        if (creature_ptr->update & (PU_MON_LITE))
        {
                creature_ptr->update &= ~(PU_MON_LITE);
-               update_mon_lite(creature_ptr, floor_ptr);
+               update_mon_lite(creature_ptr);
        }
 
        /*