OSDN Git Service

[Refactor] #37353 calc_bonuses の直接呼出しを抑止。 / Forbid call of calc_bonuses() except...
authorDeskull <deskull@users.sourceforge.jp>
Sun, 16 Dec 2018 01:33:23 +0000 (10:33 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Sun, 16 Dec 2018 01:33:23 +0000 (10:33 +0900)
src/bldg.c
src/cmd-pet.c

index e4418cc..3f46d15 100644 (file)
@@ -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;
 
index 7dfd6ff..c9f2dcf 100644 (file)
@@ -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);