From d850f26d23c470198c38f8f2362a39e2dd50fa27 Mon Sep 17 00:00:00 2001 From: Deskull Date: Sun, 16 Dec 2018 10:33:23 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#37353=20calc=5Fbonuses=20=E3=81=AE?= =?utf8?q?=E7=9B=B4=E6=8E=A5=E5=91=BC=E5=87=BA=E3=81=97=E3=82=92=E6=8A=91?= =?utf8?q?=E6=AD=A2=E3=80=82=20/=20Forbid=20call=20of=20calc=5Fbonuses()?= =?utf8?q?=20except=20handle=5Fstuff().?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/bldg.c | 7 ++++--- src/cmd-pet.c | 12 ++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/bldg.c b/src/bldg.c index e4418cc96..3f46d15e6 100644 --- a/src/bldg.c +++ b/src/bldg.c @@ -2787,8 +2787,8 @@ static PRICE compare_weapons(PRICE bcost) /* Copy i-th weapon into the weapon slot (if it's not already there) */ if (o_ptr[i] != i_ptr) object_copy(i_ptr, o_ptr[i]); - /* Get the new values */ - calc_bonuses(); + p_ptr->update |= PU_BONUS; + handle_stuff(); /* List the new values */ list_weapon(o_ptr[i], row, col); @@ -2799,7 +2799,8 @@ static PRICE compare_weapons(PRICE bcost) } /* Reset the values for the old weapon */ - calc_bonuses(); + p_ptr->update |= PU_BONUS; + handle_stuff(); character_xtra = old_character_xtra; diff --git a/src/cmd-pet.c b/src/cmd-pet.c index 7dfd6ff7c..c9f2dcf8a 100644 --- a/src/cmd-pet.c +++ b/src/cmd-pet.c @@ -26,7 +26,8 @@ bool player_can_ride_aux(cave_type *c_ptr, bool now_riding) p_ptr->riding_ryoute = p_ptr->old_riding_ryoute = FALSE; } - calc_bonuses(); + p_ptr->update |= PU_BONUS; + handle_stuff(); p_can_enter = player_can_enter(c_ptr->feat, CEM_P_CAN_ENTER_PATTERN); @@ -36,7 +37,8 @@ bool player_can_ride_aux(cave_type *c_ptr, bool now_riding) p_ptr->riding_ryoute = old_riding_ryoute; p_ptr->old_riding_ryoute = old_old_riding_ryoute; - calc_bonuses(); + p_ptr->update |= PU_BONUS; + handle_stuff(); character_xtra = old_character_xtra; @@ -1146,11 +1148,9 @@ bool rakuba(HIT_POINT dam, bool force) p_ptr->pet_extra_flags &= ~(PF_RYOUTE); p_ptr->riding_ryoute = p_ptr->old_riding_ryoute = FALSE; - calc_bonuses(); + p_ptr->update |= (PU_BONUS | PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS); + handle_stuff(); - p_ptr->update |= (PU_BONUS); - - p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS); p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); -- 2.11.0