{
OBJECT_IDX this_o_idx, next_o_idx = 0;
grid_type *g_ptr;
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Invisible trap */
if (g_ptr->mimic && is_trap(g_ptr->feat))
{
disclose_grid(y, x);
msg_print(_("トラップを発見した。", "You have found a trap."));
- disturb(FALSE, TRUE);
+ disturb(p_ptr, FALSE, TRUE);
}
/* Secret door */
{
msg_print(_("隠しドアを発見した。", "You have found a secret door."));
disclose_grid(y, x);
- disturb(FALSE, FALSE);
+ disturb(p_ptr, FALSE, FALSE);
}
/* Scan all objects in the grid */
for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
- o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[this_o_idx];
next_o_idx = o_ptr->next_o_idx;
if (o_ptr->tval != TV_CHEST) continue;
if (!chest_traps[o_ptr->pval]) continue;
{
msg_print(_("箱に仕掛けられたトラップを発見した!", "You have discovered a trap on the chest!"));
object_known(o_ptr);
- disturb(FALSE, FALSE);
+ disturb(p_ptr, FALSE, FALSE);
}
}
}
object_type *o_ptr;
- o_ptr = ¤t_floor_ptr->o_list[o_idx];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[o_idx];
#ifdef JP
object_desc(old_name, o_ptr, OD_NAME_ONLY);
*/
void carry(bool pickup)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
- o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[this_o_idx];
#ifdef ALLOW_EASY_SENSE /* TNB */
object_desc(o_name, o_ptr, 0);
next_o_idx = o_ptr->next_o_idx;
- disturb(FALSE, FALSE);
+ disturb(p_ptr, FALSE, FALSE);
/* Pick up gold */
if (o_ptr->tval == TV_GOLD)
*/
bool pattern_seq(player_type *creature_ptr, POSITION c_y, POSITION c_x, POSITION n_y, POSITION n_x)
{
- feature_type *cur_f_ptr = &f_info[current_floor_ptr->grid_array[c_y][c_x].feat];
- feature_type *new_f_ptr = &f_info[current_floor_ptr->grid_array[n_y][n_x].feat];
+ feature_type *cur_f_ptr = &f_info[p_ptr->current_floor_ptr->grid_array[c_y][c_x].feat];
+ feature_type *new_f_ptr = &f_info[p_ptr->current_floor_ptr->grid_array[n_y][n_x].feat];
bool is_pattern_tile_cur = have_flag(cur_f_ptr->flags, FF_PATTERN);
bool is_pattern_tile_new = have_flag(new_f_ptr->flags, FF_PATTERN);
int pattern_type_cur, pattern_type_new;
ok_move = PATTERN_TILE_1;
break;
default:
- if (creature_ptr->wizard)
+ if (current_world_ptr->wizard)
msg_format(_("おかしなパターン歩行、%d。", "Funny Pattern walking, %d."), pattern_type_cur);
return TRUE; /* Goof-up */
{
POSITION oy = creature_ptr->y;
POSITION ox = creature_ptr->x;
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[ny][nx];
- grid_type *oc_ptr = ¤t_floor_ptr->grid_array[oy][ox];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[ny][nx];
+ grid_type *oc_ptr = &p_ptr->current_floor_ptr->grid_array[oy][ox];
feature_type *f_ptr = &f_info[g_ptr->feat];
feature_type *of_ptr = &f_info[oc_ptr->feat];
if (om_idx > 0) /* Monster on old spot (or creature_ptr->riding) */
{
- monster_type *om_ptr = ¤t_floor_ptr->m_list[om_idx];
+ monster_type *om_ptr = &p_ptr->current_floor_ptr->m_list[om_idx];
om_ptr->fy = ny;
om_ptr->fx = nx;
update_monster(om_idx, TRUE);
if (nm_idx > 0) /* Monster on new spot */
{
- monster_type *nm_ptr = ¤t_floor_ptr->m_list[nm_idx];
+ monster_type *nm_ptr = &p_ptr->current_floor_ptr->m_list[nm_idx];
nm_ptr->fy = oy;
nm_ptr->fx = ox;
update_monster(nm_idx, TRUE);
if ((!creature_ptr->blind && !no_lite()) || !is_trap(g_ptr->feat)) g_ptr->info &= ~(CAVE_UNSAFE);
/* For get everything when requested hehe I'm *NASTY* */
- if (current_floor_ptr->dun_level && (d_info[creature_ptr->dungeon_idx].flags1 & DF1_FORGET)) wiz_dark();
+ if (p_ptr->current_floor_ptr->dun_level && (d_info[creature_ptr->dungeon_idx].flags1 & DF1_FORGET)) wiz_dark();
if (mpe_mode & MPE_HANDLE_STUFF) handle_stuff();
if (creature_ptr->pclass == CLASS_NINJA)
/* Handle "store doors" */
if (have_flag(f_ptr->flags, FF_STORE))
{
- disturb(FALSE, TRUE);
+ disturb(p_ptr, FALSE, TRUE);
free_turn(creature_ptr);
/* Hack -- Enter store */
/* Handle "building doors" -KMW- */
else if (have_flag(f_ptr->flags, FF_BLDG))
{
- disturb(FALSE, TRUE);
+ disturb(p_ptr, FALSE, TRUE);
free_turn(creature_ptr);
/* Hack -- Enter building */
/* Handle quest areas -KMW- */
else if (have_flag(f_ptr->flags, FF_QUEST_ENTER))
{
- disturb(FALSE, TRUE);
+ disturb(p_ptr, FALSE, TRUE);
free_turn(creature_ptr);
/* Hack -- Enter quest level */
leave_quest_check();
creature_ptr->inside_quest = g_ptr->special;
- current_floor_ptr->dun_level = 0;
+ p_ptr->current_floor_ptr->dun_level = 0;
creature_ptr->oldpx = 0;
creature_ptr->oldpy = 0;
/* Set off a trap */
else if (have_flag(f_ptr->flags, FF_HIT_TRAP) && !(mpe_mode & MPE_STAYING))
{
- disturb(FALSE, TRUE);
+ disturb(p_ptr, FALSE, TRUE);
/* Hidden trap */
if (g_ptr->mimic || have_flag(f_ptr->flags, FF_SECRET))
}
/* Hit the trap */
- hit_trap((mpe_mode & MPE_BREAK_TRAP) ? TRUE : FALSE);
+ hit_trap(creature_ptr, (mpe_mode & MPE_BREAK_TRAP) ? TRUE : FALSE);
if (!player_bold(ny, nx) || creature_ptr->is_dead || creature_ptr->leaving) return FALSE;
}
msg_print(_("* 注意:この先はトラップの感知範囲外です! *", "*Leaving trap detect region!*"));
}
- if (disturb_trap_detect) disturb(FALSE, TRUE);
+ if (disturb_trap_detect) disturb(p_ptr, FALSE, TRUE);
}
}
POSITION x = creature_ptr->x + ddx[dir];
/* Examine the destination */
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
feature_type *f_ptr = &f_info[g_ptr->feat];
monster_type *m_ptr;
- monster_type *riding_m_ptr = ¤t_floor_ptr->m_list[creature_ptr->riding];
+ monster_type *riding_m_ptr = &p_ptr->current_floor_ptr->m_list[creature_ptr->riding];
monster_race *riding_r_ptr = &r_info[creature_ptr->riding ? riding_m_ptr->r_idx : 0];
GAME_TEXT m_name[MAX_NLEN];
bool do_past = FALSE;
/* Exit the area */
- if (!current_floor_ptr->dun_level && !creature_ptr->wild_mode &&
+ if (!p_ptr->current_floor_ptr->dun_level && !creature_ptr->wild_mode &&
((x == 0) || (x == MAX_WID - 1) ||
(y == 0) || (y == MAX_HGT - 1)))
{
{
creature_ptr->wilderness_y--;
creature_ptr->wilderness_x--;
- creature_ptr->oldpy = current_floor_ptr->height - 2;
- creature_ptr->oldpx = current_floor_ptr->width - 2;
+ creature_ptr->oldpy = p_ptr->current_floor_ptr->height - 2;
+ creature_ptr->oldpx = p_ptr->current_floor_ptr->width - 2;
creature_ptr->ambush_flag = FALSE;
}
{
creature_ptr->wilderness_y--;
creature_ptr->wilderness_x++;
- creature_ptr->oldpy = current_floor_ptr->height - 2;
+ creature_ptr->oldpy = p_ptr->current_floor_ptr->height - 2;
creature_ptr->oldpx = 1;
creature_ptr->ambush_flag = FALSE;
}
creature_ptr->wilderness_y++;
creature_ptr->wilderness_x--;
creature_ptr->oldpy = 1;
- creature_ptr->oldpx = current_floor_ptr->width - 2;
+ creature_ptr->oldpx = p_ptr->current_floor_ptr->width - 2;
creature_ptr->ambush_flag = FALSE;
}
else if (y == 0)
{
creature_ptr->wilderness_y--;
- creature_ptr->oldpy = current_floor_ptr->height - 2;
+ creature_ptr->oldpy = p_ptr->current_floor_ptr->height - 2;
creature_ptr->oldpx = x;
creature_ptr->ambush_flag = FALSE;
}
else if (x == 0)
{
creature_ptr->wilderness_x--;
- creature_ptr->oldpx = current_floor_ptr->width - 2;
+ creature_ptr->oldpx = p_ptr->current_floor_ptr->width - 2;
creature_ptr->oldpy = y;
creature_ptr->ambush_flag = FALSE;
}
p_can_enter = FALSE;
}
- m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
if (creature_ptr->inventory_list[INVEN_RARM].name1 == ART_STORMBRINGER) stormbringer = TRUE;
if (creature_ptr->inventory_list[INVEN_LARM].name1 == ART_STORMBRINGER) stormbringer = TRUE;
/* displace? */
if ((stormbringer && (randint1(1000) > 666)) || (creature_ptr->pclass == CLASS_BERSERKER))
{
- py_attack(y, x, 0);
+ py_attack(p_ptr, y, x, 0);
oktomove = FALSE;
}
- else if (monster_can_cross_terrain(current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat, r_ptr, 0))
+ else if (monster_can_cross_terrain(p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat, r_ptr, 0))
{
do_past = TRUE;
}
}
else
{
- py_attack(y, x, 0);
+ py_attack(p_ptr, y, x, 0);
oktomove = FALSE;
}
}
msg_print(_("動けない!", "Can't move!"));
free_turn(creature_ptr);
oktomove = FALSE;
- disturb(FALSE, TRUE);
+ disturb(p_ptr, FALSE, TRUE);
}
else if (MON_MONFEAR(riding_m_ptr))
{
monster_desc(steed_name, riding_m_ptr, 0);
msg_format(_("%sが恐怖していて制御できない。", "%^s is too scared to control."), steed_name);
oktomove = FALSE;
- disturb(FALSE, TRUE);
+ disturb(p_ptr, FALSE, TRUE);
}
else if (creature_ptr->riding_ryoute)
{
oktomove = FALSE;
- disturb(FALSE, TRUE);
+ disturb(p_ptr, FALSE, TRUE);
}
else if (have_flag(f_ptr->flags, FF_CAN_FLY) && (riding_r_ptr->flags7 & RF7_CAN_FLY))
{
msg_format(_("%sの上に行けない。", "Can't swim."), f_name + f_info[get_feat_mimic(g_ptr)].name);
free_turn(creature_ptr);
oktomove = FALSE;
- disturb(FALSE, TRUE);
+ disturb(p_ptr, FALSE, TRUE);
}
else if (!have_flag(f_ptr->flags, FF_WATER) && (riding_r_ptr->flags7 & RF7_AQUATIC))
{
- msg_format(_("%sから上がれない。", "Can't land."), f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name);
+ msg_format(_("%sから上がれない。", "Can't land."), f_name + f_info[get_feat_mimic(&p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name);
free_turn(creature_ptr);
oktomove = FALSE;
- disturb(FALSE, TRUE);
+ disturb(p_ptr, FALSE, TRUE);
}
else if (have_flag(f_ptr->flags, FF_LAVA) && !(riding_r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK))
{
msg_format(_("%sの上に行けない。", "Too hot to go through."), f_name + f_info[get_feat_mimic(g_ptr)].name);
free_turn(creature_ptr);
oktomove = FALSE;
- disturb(FALSE, TRUE);
+ disturb(p_ptr, FALSE, TRUE);
}
if (oktomove && MON_STUNNED(riding_m_ptr) && one_in_(2))
monster_desc(steed_name, riding_m_ptr, 0);
msg_format(_("%sが朦朧としていてうまく動けない!", "You cannot control stunned %s!"), steed_name);
oktomove = FALSE;
- disturb(FALSE, TRUE);
+ disturb(p_ptr, FALSE, TRUE);
}
}
{
if (!trap_can_be_ignored(p_ptr, g_ptr->feat))
{
- (void)do_cmd_disarm_aux(y, x, dir);
+ (void)exe_disarm(creature_ptr, y, x, dir);
return;
}
}
}
}
- disturb(FALSE, TRUE);
+ disturb(p_ptr, FALSE, TRUE);
if (!boundary_floor(g_ptr, f_ptr, mimic_f_ptr)) sound(SOUND_HITWALL);
}
}
/* To avoid a loop with running */
- disturb(FALSE, TRUE);
+ disturb(p_ptr, FALSE, TRUE);
oktomove = FALSE;
}
if (!in_bounds2(y, x)) return (FALSE);
/* Access grid */
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Must be known to the player */
if (g_ptr->info & (CAVE_MARK))
if (!in_bounds2(y, x)) return (TRUE);
/* Memorized grids are always known */
- if (current_floor_ptr->grid_array[y][x].info & (CAVE_MARK)) return (FALSE);
+ if (p_ptr->current_floor_ptr->grid_array[y][x].info & (CAVE_MARK)) return (FALSE);
/* Viewable door/wall grids are known */
if (player_can_see_bold(y, x)) return (FALSE);
/* break run when leaving trap detected region */
if ((disturb_trap_detect || alert_trap_detect)
- && p_ptr->dtrap && !(current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_IN_DETECT))
+ && p_ptr->dtrap && !(p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_IN_DETECT))
{
/* No duplicate warning */
p_ptr->dtrap = FALSE;
/* You are just on the edge */
- if (!(current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_UNSAFE))
+ if (!(p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_UNSAFE))
{
if (alert_trap_detect)
{
col = p_ptr->x + ddx[new_dir];
/* Access grid */
- g_ptr = ¤t_floor_ptr->grid_array[row][col];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[row][col];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(g_ptr);
/* Visible monsters abort running */
if (g_ptr->m_idx)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
/* Visible monster */
if (m_ptr->ml) return (TRUE);
for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
- o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[this_o_idx];
next_o_idx = o_ptr->next_o_idx;
/* Visible object */
msg_print(_("その方向には走れません。", "You cannot run in that direction."));
- disturb(FALSE, FALSE);
+ disturb(p_ptr, FALSE, FALSE);
return;
}
/* Update run */
if (run_test())
{
- disturb(FALSE, FALSE);
+ disturb(p_ptr, FALSE, FALSE);
return;
}
{
p_ptr->run_py = 0;
p_ptr->run_px = 0;
- disturb(FALSE, FALSE);
+ disturb(p_ptr, FALSE, FALSE);
}
}
/* break run when leaving trap detected region */
if ((disturb_trap_detect || alert_trap_detect)
- && p_ptr->dtrap && !(current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_IN_DETECT))
+ && p_ptr->dtrap && !(p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_IN_DETECT))
{
/* No duplicate warning */
p_ptr->dtrap = FALSE;
/* You are just on the edge */
- if (!(current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_UNSAFE))
+ if (!(p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_UNSAFE))
{
if (alert_trap_detect)
{
POSITION col = p_ptr->x + ddx[dir];
/* Access grid */
- g_ptr = ¤t_floor_ptr->grid_array[row][col];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[row][col];
/* Visible monsters abort running */
if (g_ptr->m_idx)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
/* Visible monster */
if (m_ptr->ml) return (0);
if (!new_dir) return (0);
/* Access newly move grid */
- g_ptr = ¤t_floor_ptr->grid_array[p_ptr->y+ddy[new_dir]][p_ptr->x+ddx[new_dir]];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[p_ptr->y+ddy[new_dir]][p_ptr->x+ddx[new_dir]];
/* Close door abort traveling */
if (!easy_open && is_closed_door(g_ptr->feat)) return (0);
msg_print(_("道筋が見つかりません!", "No route is found!"));
travel.y = travel.x = 0;
}
- disturb(FALSE, TRUE);
+ disturb(p_ptr, FALSE, TRUE);
return;
}
{
POSITION x, y;
/* Check the entire dungeon / Forget the old data */
- for (y = 0; y < current_floor_ptr->height; y++)
+ for (y = 0; y < p_ptr->current_floor_ptr->height; y++)
{
- for (x = 0; x < current_floor_ptr->width; x++)
+ for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
{
travel.cost[y][x] = MAX_SHORT;
*/
static int travel_flow_cost(POSITION y, POSITION x)
{
- feature_type *f_ptr = &f_info[current_floor_ptr->grid_array[y][x].feat];
+ feature_type *f_ptr = &f_info[p_ptr->current_floor_ptr->grid_array[y][x].feat];
int cost = 1;
/* Avoid obstacles (ex. trees) */
}
/* Detected traps and doors */
- if (current_floor_ptr->grid_array[y][x].info & (CAVE_MARK))
+ if (p_ptr->current_floor_ptr->grid_array[y][x].info & (CAVE_MARK))
{
if (have_flag(f_ptr->flags, FF_DOOR)) cost += 1;
if (have_flag(f_ptr->flags, FF_TRAP)) cost += 10;
*/
static void travel_flow_aux(POSITION y, POSITION x, int n, bool wall)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
feature_type *f_ptr = &f_info[g_ptr->feat];
int old_head = flow_head;
int add_cost = 1;
int cost;
/* Ignore out of bounds */
- if (!in_bounds(y, x)) return;
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x)) return;
/* Ignore unknown grid except in wilderness */
- if (current_floor_ptr->dun_level > 0 && !(g_ptr->info & CAVE_KNOWN)) return;
+ if (p_ptr->current_floor_ptr->dun_level > 0 && !(g_ptr->info & CAVE_KNOWN)) return;
/* Ignore "walls" and "rubble" (include "secret doors") */
if (have_flag(f_ptr->flags, FF_WALL) ||
have_flag(f_ptr->flags, FF_CAN_DIG) ||
- (have_flag(f_ptr->flags, FF_DOOR) && current_floor_ptr->grid_array[y][x].mimic) ||
+ (have_flag(f_ptr->flags, FF_DOOR) && p_ptr->current_floor_ptr->grid_array[y][x].mimic) ||
(!have_flag(f_ptr->flags, FF_MOVE) && have_flag(f_ptr->flags, FF_CAN_FLY) && !p_ptr->levitation))
{
if (!wall || !from_wall) return;
POSITION x, y;
DIRECTION d;
bool wall = FALSE;
- feature_type *f_ptr = &f_info[current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].feat];
+ feature_type *f_ptr = &f_info[p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].feat];
/* Reset the "queue" */
flow_head = flow_tail = 0;
* @brief トラベル処理のメインルーチン
* @return なし
*/
-void do_cmd_travel(void)
+void do_cmd_travel(player_type *creature_ptr)
{
POSITION x, y;
int i;
}
else if (!tgt_pt(&x, &y)) return;
- if ((x == p_ptr->x) && (y == p_ptr->y))
+ if ((x == creature_ptr->x) && (y == creature_ptr->y))
{
msg_print(_("すでにそこにいます!", "You are already there!!"));
return;
}
- f_ptr = &f_info[current_floor_ptr->grid_array[y][x].feat];
+ f_ptr = &f_info[p_ptr->current_floor_ptr->grid_array[y][x].feat];
- if ((current_floor_ptr->grid_array[y][x].info & CAVE_MARK) &&
+ if ((p_ptr->current_floor_ptr->grid_array[y][x].info & CAVE_MARK) &&
(have_flag(f_ptr->flags, FF_WALL) ||
have_flag(f_ptr->flags, FF_CAN_DIG) ||
- (have_flag(f_ptr->flags, FF_DOOR) && current_floor_ptr->grid_array[y][x].mimic)))
+ (have_flag(f_ptr->flags, FF_DOOR) && p_ptr->current_floor_ptr->grid_array[y][x].mimic)))
{
msg_print(_("そこには行くことができません!", "You cannot travel there!"));
return;
travel.dir = 0;
/* Decides first direction */
- dx = abs(p_ptr->x - x);
- dy = abs(p_ptr->y - y);
- sx = ((x == p_ptr->x) || (dx < dy)) ? 0 : ((x > p_ptr->x) ? 1 : -1);
- sy = ((y == p_ptr->y) || (dy < dx)) ? 0 : ((y > p_ptr->y) ? 1 : -1);
+ dx = abs(creature_ptr->x - x);
+ dy = abs(creature_ptr->y - y);
+ sx = ((x == creature_ptr->x) || (dx < dy)) ? 0 : ((x > creature_ptr->x) ? 1 : -1);
+ sy = ((y == creature_ptr->y) || (dy < dx)) ? 0 : ((y > creature_ptr->y) ? 1 : -1);
for (i = 1; i <= 9; i++)
{
* The second arg is currently unused, but could induce output flush.
* All disturbance cancels repeated commands, resting, and running.
*/
-void disturb(bool stop_search, bool stop_travel)
+void disturb(player_type *creature_ptr, bool stop_search, bool stop_travel)
{
#ifndef TRAVEL
/* Unused */
command_rep = 0;
/* Redraw the state (later) */
- p_ptr->redraw |= (PR_STATE);
+ creature_ptr->redraw |= (PR_STATE);
}
/* Cancel Resting */
- if ((p_ptr->action == ACTION_REST) || (p_ptr->action == ACTION_FISH) || (stop_search && (p_ptr->action == ACTION_SEARCH)))
+ if ((creature_ptr->action == ACTION_REST) || (creature_ptr->action == ACTION_FISH) || (stop_search && (creature_ptr->action == ACTION_SEARCH)))
{
/* Cancel */
- set_action(p_ptr, ACTION_NONE);
+ set_action(creature_ptr, ACTION_NONE);
}
/* Cancel running */
- if (p_ptr->running)
+ if (creature_ptr->running)
{
/* Cancel */
- p_ptr->running = 0;
+ creature_ptr->running = 0;
/* Check for new panel if appropriate */
if (center_player && !center_running) verify_panel();
/* Calculate torch radius */
- p_ptr->update |= (PU_TORCH);
+ creature_ptr->update |= (PU_TORCH);
/* Update monster flow */
- p_ptr->update |= (PU_FLOW);
+ creature_ptr->update |= (PU_FLOW);
}
#ifdef TRAVEL
if (center_player && !center_running) verify_panel();
/* Calculate torch radius */
- p_ptr->update |= (PU_TORCH);
+ creature_ptr->update |= (PU_TORCH);
}
#endif