From c43c470828874b46933e6a2b5ece6bf5b0f94f52 Mon Sep 17 00:00:00 2001 From: Hourier Date: Wed, 22 Jul 2020 21:19:30 +0900 Subject: [PATCH] [Refactor] #40480 Reshaped monst_spell_monst() --- src/melee/melee-spell.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/melee/melee-spell.c b/src/melee/melee-spell.c index 30d6adb74..b4ac5f080 100644 --- a/src/melee/melee-spell.c +++ b/src/melee/melee-spell.c @@ -137,17 +137,13 @@ bool monst_spell_monst(player_type *target_ptr, MONSTER_IDX m_idx) ms_ptr->x = ms_ptr->t_ptr->fx; reset_target(ms_ptr->m_ptr); ms_ptr->f6 &= ~(RF6_WORLD | RF6_TRAPS | RF6_FORGET); - if (ms_ptr->f4 & RF4_BR_LITE) { - if (!los(target_ptr, ms_ptr->m_ptr->fy, ms_ptr->m_ptr->fx, ms_ptr->t_ptr->fy, ms_ptr->t_ptr->fx)) - ms_ptr->f4 &= ~(RF4_BR_LITE); - } + if (((ms_ptr->f4 & RF4_BR_LITE) != 0) && !los(target_ptr, ms_ptr->m_ptr->fy, ms_ptr->m_ptr->fx, ms_ptr->t_ptr->fy, ms_ptr->t_ptr->fx)) + ms_ptr->f4 &= ~(RF4_BR_LITE); - if (ms_ptr->f6 & RF6_SPECIAL) { - if ((ms_ptr->m_ptr->r_idx != MON_ROLENTO) && (ms_ptr->r_ptr->d_char != 'B')) - ms_ptr->f6 &= ~(RF6_SPECIAL); - } + if (((ms_ptr->f6 & RF6_SPECIAL) != 0) && (ms_ptr->m_ptr->r_idx != MON_ROLENTO) && (ms_ptr->r_ptr->d_char != 'B')) + ms_ptr->f6 &= ~(RF6_SPECIAL); - if (ms_ptr->f6 & RF6_DARKNESS) { + if ((ms_ptr->f6 & RF6_DARKNESS) != 0) { bool vs_ninja = (target_ptr->pclass == CLASS_NINJA) && !is_hostile(ms_ptr->t_ptr); bool can_use_lite_area = vs_ninja && !(ms_ptr->r_ptr->flags3 & (RF3_UNDEAD | RF3_HURT_LITE)) && !(ms_ptr->r_ptr->flags7 & RF7_DARK_MASK); if (!(ms_ptr->r_ptr->flags2 & RF2_STUPID)) { -- 2.11.0