From eb25ee65ea03da4e08276e93b3320ae32507abd2 Mon Sep 17 00:00:00 2001 From: Deskull Date: Tue, 8 Jan 2019 12:58:36 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#37353=20=E3=82=B3=E3=83=A1?= =?utf8?q?=E3=83=B3=E3=83=88=E6=95=B4=E7=90=86=E3=80=82=20/=20Refactor=20c?= =?utf8?q?omments.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/cmd2.c | 2 -- src/dungeon.c | 2 -- src/effects.c | 78 -------------------------------------------------------- src/object2.c | 8 ------ src/realm-hex.c | 2 -- src/realm-song.c | 4 --- src/spells3.c | 17 ++---------- src/wizard2.c | 4 --- 8 files changed, 2 insertions(+), 115 deletions(-) diff --git a/src/cmd2.c b/src/cmd2.c index 4101bfde5..17a2bdc8b 100644 --- a/src/cmd2.c +++ b/src/cmd2.c @@ -2189,8 +2189,6 @@ void do_cmd_rest(void) /* Save the rest code */ resting = command_arg; p_ptr->action = ACTION_REST; - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Redraw the state */ diff --git a/src/dungeon.c b/src/dungeon.c index 4eeab5064..ccf459041 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -1200,8 +1200,6 @@ static void check_music(void) INTERUPTING_SONG_EFFECT(p_ptr) = MUSIC_NONE; msg_print(_("歌を再開した。", "You restart singing.")); p_ptr->action = ACTION_SING; - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS | PU_HP); /* Redraw map and status bar */ diff --git a/src/effects.c b/src/effects.c index 792061321..853c3a2c9 100644 --- a/src/effects.c +++ b/src/effects.c @@ -116,8 +116,6 @@ void set_action(ACTION_IDX typ) break; } } - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Redraw the state */ @@ -271,8 +269,6 @@ void dispel_player(void) SINGING_SONG_EFFECT(p_ptr) = MUSIC_NONE; msg_format(_("%sが途切れた。", "Your %s is interrupted."), str); p_ptr->action = ACTION_NONE; - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS | PU_HP); p_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE); @@ -340,8 +336,6 @@ bool set_mimic(TIME_EFFECT v, IDX p, bool do_dec) /* Redraw title */ p_ptr->redraw |= (PR_BASIC | PR_STATUS); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS | PU_HP); handle_stuff(); @@ -793,8 +787,6 @@ bool set_fast(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); handle_stuff(); return (TRUE); @@ -850,8 +842,6 @@ bool set_lightspeed(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); handle_stuff(); return (TRUE); @@ -903,8 +893,6 @@ bool set_slow(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); handle_stuff(); return (TRUE); @@ -960,8 +948,6 @@ bool set_shield(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); handle_stuff(); return (TRUE); @@ -1017,8 +1003,6 @@ bool set_tsubureru(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); handle_stuff(); return (TRUE); @@ -1074,8 +1058,6 @@ bool set_magicdef(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); handle_stuff(); return (TRUE); @@ -1130,8 +1112,6 @@ bool set_blessed(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); handle_stuff(); return (TRUE); @@ -1187,8 +1167,6 @@ bool set_hero(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Recalculate hitpoints */ @@ -1247,8 +1225,6 @@ bool set_shero(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Recalculate hitpoints */ @@ -1373,8 +1349,6 @@ bool set_wraith_form(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); handle_stuff(); return (TRUE); @@ -1447,8 +1421,6 @@ bool set_invuln(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); handle_stuff(); return (TRUE); @@ -1503,8 +1475,6 @@ bool set_tim_esp(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); p_ptr->update |= (PU_MONSTERS); handle_stuff(); @@ -1560,8 +1530,6 @@ bool set_tim_invis(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Update the monsters */ @@ -1619,8 +1587,6 @@ bool set_tim_infra(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Update the monsters */ @@ -1678,8 +1644,6 @@ bool set_tim_regen(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); handle_stuff(); return (TRUE); @@ -1734,8 +1698,6 @@ bool set_tim_stealth(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); handle_stuff(); return (TRUE); @@ -1847,8 +1809,6 @@ bool set_tim_levitation(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); handle_stuff(); return (TRUE); @@ -1956,8 +1916,6 @@ bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); handle_stuff(); return (TRUE); @@ -2012,8 +1970,6 @@ bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); handle_stuff(); return (TRUE); @@ -2068,8 +2024,6 @@ bool set_tim_eyeeye(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); handle_stuff(); return (TRUE); @@ -2125,8 +2079,6 @@ bool set_resist_magic(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); handle_stuff(); return (TRUE); @@ -2181,8 +2133,6 @@ bool set_tim_reflect(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); handle_stuff(); return (TRUE); @@ -2235,8 +2185,6 @@ bool set_multishadow(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); handle_stuff(); return (TRUE); @@ -2291,8 +2239,6 @@ bool set_dustrobe(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); handle_stuff(); return (TRUE); @@ -2347,8 +2293,6 @@ bool set_kabenuke(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); handle_stuff(); return (TRUE); @@ -2409,8 +2353,6 @@ bool set_tsuyoshi(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Recalculate hitpoints */ @@ -2986,8 +2928,6 @@ bool set_stun(TIME_EFFECT v) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Redraw the "stun" */ @@ -3181,8 +3121,6 @@ bool set_cut(TIME_EFFECT v) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Redraw the "cut" */ @@ -3377,8 +3315,6 @@ bool set_food(TIME_EFFECT v) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Redraw hunger */ @@ -3442,8 +3378,6 @@ bool inc_stat(int stat) { p_ptr->stat_max[stat] = value; } - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Success */ @@ -3577,8 +3511,6 @@ bool dec_stat(int stat, int amount, int permanent) /* Redisplay the stats later */ p_ptr->redraw |= (PR_STATS); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); } @@ -3598,8 +3530,6 @@ bool res_stat(int stat) { /* Restore */ p_ptr->stat_cur[stat] = p_ptr->stat_max[stat]; - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Redisplay the stats later */ @@ -3868,8 +3798,6 @@ bool lose_all_info(void) /* Hack -- Clear the "felt" flag */ o_ptr->ident &= ~(IDENT_SENSE); } - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Combine / Reorder the pack (later) */ @@ -4684,8 +4612,6 @@ bool set_ultimate_res(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); handle_stuff(); return (TRUE); @@ -4734,8 +4660,6 @@ bool set_tim_res_nether(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); handle_stuff(); return (TRUE); @@ -4784,8 +4708,6 @@ bool set_tim_res_time(TIME_EFFECT v, bool do_dec) if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); handle_stuff(); return (TRUE); diff --git a/src/object2.c b/src/object2.c index daad1a416..9c7e9815b 100644 --- a/src/object2.c +++ b/src/object2.c @@ -5653,8 +5653,6 @@ void inven_item_increase(INVENTORY_IDX item, ITEM_NUMBER num) /* Add the weight */ p_ptr->total_weight += (num * o_ptr->weight); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Recalculate mana XXX */ @@ -5725,8 +5723,6 @@ void inven_item_optimize(INVENTORY_IDX item) /* Erase the empty slot */ object_wipe(&inventory[item]); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Recalculate torch */ @@ -6022,8 +6018,6 @@ s16b inven_carry(object_type *o_ptr) /* Increase the weight */ p_ptr->total_weight += (o_ptr->number * o_ptr->weight); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); p_ptr->window |= (PW_INVEN); @@ -6100,8 +6094,6 @@ s16b inven_carry(object_type *o_ptr) /* Count the items */ inven_cnt++; - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Combine and Reorder pack */ diff --git a/src/realm-hex.c b/src/realm-hex.c index 83169c5fa..9fd9e8f79 100644 --- a/src/realm-hex.c +++ b/src/realm-hex.c @@ -884,8 +884,6 @@ cptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode) if (p_ptr->stat_cur[i] > p_ptr->stat_max[i]) p_ptr->stat_cur[i] = p_ptr->stat_max[i]; - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); flag = TRUE; diff --git a/src/realm-song.c b/src/realm-song.c index 724a4f638..a479e9238 100644 --- a/src/realm-song.c +++ b/src/realm-song.c @@ -19,8 +19,6 @@ static void start_singing(SPELL_IDX spell, MAGIC_NUM1 song) /* Now the player is singing */ set_action(ACTION_SING); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Redraw status bar */ @@ -54,8 +52,6 @@ void stop_singing(void) SINGING_SONG_EFFECT(p_ptr) = MUSIC_NONE; SINGING_SONG_ID(p_ptr) = 0; - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Redraw status bar */ diff --git a/src/spells3.c b/src/spells3.c index e074f748a..200a3b55b 100644 --- a/src/spells3.c +++ b/src/spells3.c @@ -1037,8 +1037,6 @@ msg_format("%s(%c)は劣化を跳ね返した!",o_name, index_to_label(t) ); chg_virtue(V_HARMONY, 1); chg_virtue(V_ENCHANT, -2); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); p_ptr->window |= (PW_EQUIP | PW_PLAYER); @@ -2127,8 +2125,6 @@ bool enchant(object_type *o_ptr, int n, int eflag) /* Failure */ if (!res) return (FALSE); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Combine / Reorder the pack (later) */ @@ -2281,8 +2277,7 @@ bool artifact_scroll(void) #ifdef JP msg_format("%sは既に強化されています!", o_name ); #else - msg_format("The %s %s already %s!", - o_name, ((o_ptr->number > 1) ? "are" : "is"), + msg_format("The %s %s already %s!", o_name, ((o_ptr->number > 1) ? "are" : "is"), ((o_ptr->number > 1) ? "customized items" : "a customized item")); #endif } @@ -2291,7 +2286,7 @@ bool artifact_scroll(void) { if (o_ptr->number > 1) { - msg_print(_("複数のアイテムに魔法をかけるだけのエネルギーはありません!", "Not enough enough energy to enchant more than one object!")); + msg_print(_("複数のアイテムに魔法をかけるだけのエネルギーはありません!", "Not enough energy to enchant more than one object!")); #ifdef JP msg_format("%d 個の%sが壊れた!",(o_ptr->number)-1, o_name); #else @@ -2362,8 +2357,6 @@ bool identify_item(object_type *o_ptr) /* Player touches it */ o_ptr->marked |= OM_TOUCHED; - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Combine / Reorder the pack (later) */ @@ -3069,8 +3062,6 @@ msg_format("%s は劣化した!", } } - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); p_ptr->window |= (PW_EQUIP | PW_PLAYER); @@ -4086,8 +4077,6 @@ msg_format("%sが%sを包み込もうとしたが、%sはそれを跳ね返し /* Break it */ o_ptr->ident |= (IDENT_BROKEN); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Recalculate mana */ @@ -4152,8 +4141,6 @@ bool curse_weapon_object(bool force, object_type *o_ptr) /* Break it */ o_ptr->ident |= (IDENT_BROKEN); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Recalculate mana */ diff --git a/src/wizard2.c b/src/wizard2.c index ec5724bb6..d00500050 100644 --- a/src/wizard2.c +++ b/src/wizard2.c @@ -985,8 +985,6 @@ static void wiz_reroll_item(object_type *o_ptr) { /* Apply changes */ object_copy(o_ptr, q_ptr); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Combine / Reorder the pack (later) */ @@ -1341,8 +1339,6 @@ static void do_cmd_wiz_play(void) /* Change */ object_copy(o_ptr, q_ptr); - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Combine / Reorder the pack (later) */ -- 2.11.0