From 011b6eb2eacf5186024e1eecc898bda89913384b Mon Sep 17 00:00:00 2001 From: deskull Date: Sun, 15 Dec 2019 00:30:38 +0900 Subject: [PATCH] =?utf8?q?[Fix]=20#38997=20teleport=5Flevel=5Fother()=20?= =?utf8?q?=E5=86=85=E5=A4=89=E6=95=B0=E5=8F=82=E7=85=A7=E4=BF=AE=E6=AD=A3?= =?utf8?q?=EF=BC=8E=20/=20Fix=20variable=20references=20in=20teleport=5Fle?= =?utf8?q?vel=5Fother().?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/spells.h | 2 +- src/spells3.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/spells.h b/src/spells.h index 33399ba8a..e6aea3fd3 100644 --- a/src/spells.h +++ b/src/spells.h @@ -290,7 +290,7 @@ extern void teleport_player(player_type *creature_ptr, POSITION dis, BIT_FLAGS m extern void teleport_player_away(MONSTER_IDX m_idx, POSITION dis); extern void teleport_player_to(player_type *creature_ptr, POSITION ny, POSITION nx, BIT_FLAGS mode); extern void teleport_away_followable(MONSTER_IDX m_idx); -extern bool teleport_level_other(player_type *creature_ptr); +extern bool teleport_level_other(player_type *caster_ptr); extern void teleport_level(player_type *creature_ptr, MONSTER_IDX m_idx); extern bool recall_player(player_type *creature_ptr, TIME_EFFECT turns); extern bool free_level_recall(player_type *creature_ptr); diff --git a/src/spells3.c b/src/spells3.c index fb68b3cb1..380b2378c 100644 --- a/src/spells3.c +++ b/src/spells3.c @@ -585,7 +585,7 @@ void teleport_away_followable(MONSTER_IDX m_idx) } -bool teleport_level_other(player_type *creature_ptr) +bool teleport_level_other(player_type *caster_ptr) { MONSTER_IDX target_m_idx; monster_type *m_ptr; @@ -593,21 +593,21 @@ bool teleport_level_other(player_type *creature_ptr) GAME_TEXT m_name[MAX_NLEN]; if (!target_set(TARGET_KILL)) return FALSE; - target_m_idx = p_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx; + target_m_idx = caster_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx; if (!target_m_idx) return TRUE; - if (!player_has_los_bold(p_ptr, target_row, target_col)) return TRUE; - if (!projectable(creature_ptr->current_floor_ptr, creature_ptr->y, creature_ptr->x, target_row, target_col)) return TRUE; - m_ptr = &p_ptr->current_floor_ptr->m_list[target_m_idx]; + if (!player_has_los_bold(caster_ptr, target_row, target_col)) return TRUE; + if (!projectable(caster_ptr->current_floor_ptr, caster_ptr->y, caster_ptr->x, target_row, target_col)) return TRUE; + m_ptr = &caster_ptr->current_floor_ptr->m_list[target_m_idx]; r_ptr = &r_info[m_ptr->r_idx]; monster_desc(m_name, m_ptr, 0); msg_format(_("%^sの足を指さした。", "You gesture at %^s's feet."), m_name); if ((r_ptr->flagsr & (RFR_EFF_RES_NEXU_MASK | RFR_RES_TELE)) || - (r_ptr->flags1 & RF1_QUESTOR) || (r_ptr->level + randint1(50) > creature_ptr->lev + randint1(60))) + (r_ptr->flags1 & RF1_QUESTOR) || (r_ptr->level + randint1(50) > caster_ptr->lev + randint1(60))) { msg_format(_("しかし効果がなかった!", "%^s is unaffected!"), m_name); } - else teleport_level(creature_ptr, target_m_idx); + else teleport_level(caster_ptr, target_m_idx); return TRUE; } -- 2.11.0