#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
if (item >= 0) o_ptr = &inventory[item];
/* Get the item (on the floor) */
- else o_ptr = &o_list[0 - item];
+ else o_ptr = ¤t_floor_ptr->o_list[0 - item];
if (o_ptr->k_idx && (o_ptr->marked & OM_AUTODESTROY))
{
autopick_delayed_alter_aux(item);
/* Scan the pile of objects */
- item = cave[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;
}
if (item >= 0) o_ptr = &inventory[item];
/* Get the item (on the floor) */
- else o_ptr = &o_list[0 - item];
+ else o_ptr = ¤t_floor_ptr->o_list[0 - item];
/* Get the index in the auto-pick/destroy list */
idx = is_autopick(o_ptr);
/*
* Automatically pickup/destroy items in this grid.
*/
-void autopick_pickup_items(cave_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 = ¤t_floor_ptr->o_list[this_o_idx];
+ next_o_idx = o_ptr->next_o_idx;
idx = is_autopick(o_ptr);
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 */
/* 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 */