OSDN Git Service

[Refactor] #37353 files.h を追加して宣言を分離。
[hengband/hengband.git] / src / autopick.c
index 52f5937..8a980eb 100644 (file)
 #include "angband.h"
 #include "store.h"
 #include "player-status.h"
+#include "player-move.h"
+#include "object-flavor.h"
+#include "object-hook.h"
+
+#include "files.h"
 
 #define MAX_LINELEN 1024
 
@@ -1615,7 +1620,7 @@ static void autopick_delayed_alter_aux(INVENTORY_IDX item)
        if (item >= 0) o_ptr = &inventory[item];
 
        /* Get the item (on the floor) */
-       else o_ptr = &o_list[0 - item];
+       else o_ptr = &current_floor_ptr->o_list[0 - item];
 
        if (o_ptr->k_idx && (o_ptr->marked & OM_AUTODESTROY))
        {
@@ -1657,10 +1662,10 @@ void autopick_delayed_alter(void)
                autopick_delayed_alter_aux(item);
 
        /* Scan the pile of objects */
-       item = grid_array[p_ptr->y][p_ptr->x].o_idx;
+       item = current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx;
        while (item)
        {
-               OBJECT_IDX next = o_list[item].next_o_idx;
+               OBJECT_IDX next = current_floor_ptr->o_list[item].next_o_idx;
                autopick_delayed_alter_aux(-item);
                item = next;
        }
@@ -1682,7 +1687,7 @@ void autopick_alter_item(INVENTORY_IDX item, bool destroy)
        if (item >= 0) o_ptr = &inventory[item];
 
        /* Get the item (on the floor) */
-       else o_ptr = &o_list[0 - item];
+       else o_ptr = &current_floor_ptr->o_list[0 - item];
 
        /* Get the index in the auto-pick/destroy list */
        idx = is_autopick(o_ptr);
@@ -1699,18 +1704,16 @@ void autopick_alter_item(INVENTORY_IDX item, bool destroy)
 /*
  * Automatically pickup/destroy items in this grid.
  */
-void autopick_pickup_items(grid_type *c_ptr)
+void autopick_pickup_items(grid_type *g_ptr)
 {
        OBJECT_IDX this_o_idx, next_o_idx = 0;
        
        /* Scan the pile of objects */
-       for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
+       for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
        {
                int idx;
-                       object_type *o_ptr = &o_list[this_o_idx];
-               
-               /* Acquire next object */
-               next_o_idx = o_ptr->next_o_idx;
+                       object_type *o_ptr = &current_floor_ptr->o_list[this_o_idx];
+                               next_o_idx = o_ptr->next_o_idx;
 
                idx = is_autopick(o_ptr);
 
@@ -5993,19 +5996,19 @@ void do_cmd_edit_autopick(void)
        tb->dirty_line = -1;
        tb->filename_mode = PT_DEFAULT;
 
-       if (turn < old_autosave_turn)
+       if (current_world_ptr->game_turn < old_autosave_turn)
        {
-               while (old_autosave_turn > turn) old_autosave_turn -= TURNS_PER_TICK * TOWN_DAWN;
+               while (old_autosave_turn > current_world_ptr->game_turn) old_autosave_turn -= TURNS_PER_TICK * TOWN_DAWN;
        }
 
        /* Autosave */
-       if (turn > old_autosave_turn + 100L)
+       if (current_world_ptr->game_turn > old_autosave_turn + 100L)
        {
                do_cmd_save_game(TRUE);
-               old_autosave_turn = turn;
+               old_autosave_turn = current_world_ptr->game_turn;
        }
 
-       /* HACK -- Reset start_time to stop counting playtime while edit */
+       /* HACK -- Reset start_time to stop counting current_world_ptr->play_time while edit */
        update_playtime();
 
        /* Free old entries */
@@ -6131,7 +6134,7 @@ void do_cmd_edit_autopick(void)
        /* Reload autopick pref */
        process_autopick_file(buf);
 
-       /* HACK -- reset start_time so that playtime is not increase while edit */
+       /* HACK -- reset start_time so that current_world_ptr->play_time is not increase while edit */
        start_time = (u32b)time(NULL);
 
        /* Save cursor location */