From 8c3495f93768c6c187af47373dfba9f689cf944f Mon Sep 17 00:00:00 2001 From: dis- Date: Wed, 3 Mar 2021 12:43:47 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20BIT=E6=BC=94=E7=AE=97=E3=83=9E?= =?utf8?q?=E3=82=AF=E3=83=AD=E3=81=B8=E3=81=AE=E7=BD=AE=E6=8F=9B=E3=82=92?= =?utf8?q?=E9=80=B2=E3=82=81=E3=82=8B=E3=80=82racial-switcher.c?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 可読性向上のため、BIT演算マクロを使用する。 動作変更は行わない。 --- src/racial/racial-switcher.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/racial/racial-switcher.c b/src/racial/racial-switcher.c index 0d18afee6..e158a103f 100644 --- a/src/racial/racial-switcher.c +++ b/src/racial/racial-switcher.c @@ -74,6 +74,7 @@ #include "status/buff-setter.h" #include "status/experience.h" #include "target/target-getter.h" +#include "util/bit-flags-calculator.h" #include "util/int-char-converter.h" #include "view/display-messages.h" @@ -128,7 +129,7 @@ bool switch_class_racial_execution(player_type *creature_ptr, const s32b command case CLASS_CHAOS_WARRIOR: return confusing_light(creature_ptr); case CLASS_MONK: - if (!(empty_hands(creature_ptr, TRUE) & EMPTY_HAND_MAIN)) { + if (none_bits(empty_hands(creature_ptr, TRUE), EMPTY_HAND_MAIN)) { msg_print(_("素手じゃないとできません。", "You need to be barehanded.")); return FALSE; } @@ -142,7 +143,7 @@ bool switch_class_racial_execution(player_type *creature_ptr, const s32b command if (!choose_monk_stance(creature_ptr)) return FALSE; - creature_ptr->update |= PU_BONUS; + set_bits(creature_ptr->update, PU_BONUS); return TRUE; } @@ -222,7 +223,7 @@ bool switch_class_racial_execution(player_type *creature_ptr, const s32b command if (!choose_kata(creature_ptr)) return FALSE; - creature_ptr->update |= PU_BONUS; + set_bits(creature_ptr->update, PU_BONUS); return TRUE; case CLASS_BLUE_MAGE: set_action(creature_ptr, creature_ptr->action == ACTION_LEARN ? ACTION_NONE : ACTION_LEARN); @@ -299,7 +300,7 @@ bool switch_race_racial_execution(player_type *creature_ptr, const s32b command) reserve_alter_reality(creature_ptr, randint0(21) + 15); return TRUE; } - + if (command != -2) return TRUE; -- 2.11.0