• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision302e3057cf02f3fe64396e279bc3ba77ad5fb58b (tree)
Time2019-01-08 23:08:48
AuthorDeskull <deskull@user...>
CommiterDeskull

Log Message

[Refactor] #38852 update_creature()に引数追加。 / Add argument to update_creature().

Change Summary

Incremental Difference

--- a/src/birth.c
+++ b/src/birth.c
@@ -4385,7 +4385,6 @@ static bool player_birth_aux(void)
43854385 /* Flush input */
43864386 flush();
43874387
4388-
43894388 /*** Display ***/
43904389
43914390 /* Mode */
@@ -4405,7 +4404,7 @@ static bool player_birth_aux(void)
44054404 {
44064405 /* Calculate the bonuses and hitpoints */
44074406 p_ptr->update |= (PU_BONUS | PU_HP);
4408- handle_stuff();
4407+ update_creature(p_ptr);
44094408
44104409 p_ptr->chp = p_ptr->mhp;
44114410 p_ptr->csp = p_ptr->msp;
--- a/src/cmd2.c
+++ b/src/cmd2.c
@@ -2172,7 +2172,7 @@ void do_cmd_rest(void)
21722172 resting = command_arg;
21732173 p_ptr->action = ACTION_REST;
21742174 p_ptr->update |= (PU_BONUS);
2175- update_creature();
2175+ update_creature(p_ptr);
21762176
21772177 p_ptr->redraw |= (PR_STATE);
21782178 update_output();
--- a/src/externs.h
+++ b/src/externs.h
@@ -1177,7 +1177,7 @@ extern s16b calc_num_fire(object_type *o_ptr);
11771177 extern void calc_bonuses(void);
11781178 extern void handle_stuff(void);
11791179 extern void update_output(void);
1180-extern void update_creature(void);
1180+extern void update_creature(player_type *creature_ptr);
11811181 extern BIT_FLAGS16 empty_hands(bool riding_control);
11821182 extern bool heavy_armor(void);
11831183 extern void print_monster_list(TERM_LEN x, TERM_LEN y, TERM_LEN max_lines);
--- a/src/xtra1.c
+++ b/src/xtra1.c
@@ -5960,7 +5960,7 @@ static void window_stuff(void)
59605960 */
59615961 void handle_stuff(void)
59625962 {
5963- if (p_ptr->update) update_creature();
5963+ if (p_ptr->update) update_creature(p_ptr);
59645964 if (p_ptr->redraw) redraw_stuff();
59655965 if (p_ptr->window) window_stuff();
59665966 }
@@ -5976,59 +5976,58 @@ void update_output(void)
59765976 * @return なし
59775977 * @details 更新処理の対象はプレイヤーの能力修正/光源寿命/HP/MP/魔法の学習状態、他多数の外界の状態判定。
59785978 */
5979-void update_creature(void)
5979+void update_creature(player_type *creature_ptr)
59805980 {
5981-
5982- if (!p_ptr->update) return;
5981+ if (!creature_ptr->update) return;
59835982
59845983 /* Actually do auto-destroy */
5985- if (p_ptr->update & (PU_AUTODESTROY))
5984+ if (creature_ptr->update & (PU_AUTODESTROY))
59865985 {
5987- p_ptr->update &= ~(PU_AUTODESTROY);
5986+ creature_ptr->update &= ~(PU_AUTODESTROY);
59885987 autopick_delayed_alter();
59895988 }
59905989
59915990 /* Combine the pack */
5992- if (p_ptr->update & (PU_COMBINE))
5991+ if (creature_ptr->update & (PU_COMBINE))
59935992 {
5994- p_ptr->update &= ~(PU_COMBINE);
5993+ creature_ptr->update &= ~(PU_COMBINE);
59955994 combine_pack();
59965995 }
59975996
59985997 /* Reorder the pack */
5999- if (p_ptr->update & (PU_REORDER))
5998+ if (creature_ptr->update & (PU_REORDER))
60005999 {
6001- p_ptr->update &= ~(PU_REORDER);
6000+ creature_ptr->update &= ~(PU_REORDER);
60026001 reorder_pack();
60036002 }
60046003
6005- if (p_ptr->update & (PU_BONUS))
6004+ if (creature_ptr->update & (PU_BONUS))
60066005 {
6007- p_ptr->update &= ~(PU_BONUS);
6006+ creature_ptr->update &= ~(PU_BONUS);
60086007 calc_bonuses();
60096008 }
60106009
6011- if (p_ptr->update & (PU_TORCH))
6010+ if (creature_ptr->update & (PU_TORCH))
60126011 {
6013- p_ptr->update &= ~(PU_TORCH);
6012+ creature_ptr->update &= ~(PU_TORCH);
60146013 calc_torch();
60156014 }
60166015
6017- if (p_ptr->update & (PU_HP))
6016+ if (creature_ptr->update & (PU_HP))
60186017 {
6019- p_ptr->update &= ~(PU_HP);
6018+ creature_ptr->update &= ~(PU_HP);
60206019 calc_hitpoints();
60216020 }
60226021
6023- if (p_ptr->update & (PU_MANA))
6022+ if (creature_ptr->update & (PU_MANA))
60246023 {
6025- p_ptr->update &= ~(PU_MANA);
6024+ creature_ptr->update &= ~(PU_MANA);
60266025 calc_mana();
60276026 }
60286027
6029- if (p_ptr->update & (PU_SPELLS))
6028+ if (creature_ptr->update & (PU_SPELLS))
60306029 {
6031- p_ptr->update &= ~(PU_SPELLS);
6030+ creature_ptr->update &= ~(PU_SPELLS);
60326031 calc_spells();
60336032 }
60346033
@@ -6038,50 +6037,50 @@ void update_creature(void)
60386037 /* Character is in "icky" mode, no screen updates */
60396038 if (character_icky) return;
60406039
6041- if (p_ptr->update & (PU_UN_LITE))
6040+ if (creature_ptr->update & (PU_UN_LITE))
60426041 {
6043- p_ptr->update &= ~(PU_UN_LITE);
6042+ creature_ptr->update &= ~(PU_UN_LITE);
60446043 forget_lite();
60456044 }
60466045
6047- if (p_ptr->update & (PU_UN_VIEW))
6046+ if (creature_ptr->update & (PU_UN_VIEW))
60486047 {
6049- p_ptr->update &= ~(PU_UN_VIEW);
6048+ creature_ptr->update &= ~(PU_UN_VIEW);
60506049 forget_view();
60516050 }
60526051
6053- if (p_ptr->update & (PU_VIEW))
6052+ if (creature_ptr->update & (PU_VIEW))
60546053 {
6055- p_ptr->update &= ~(PU_VIEW);
6054+ creature_ptr->update &= ~(PU_VIEW);
60566055 update_view();
60576056 }
60586057
6059- if (p_ptr->update & (PU_LITE))
6058+ if (creature_ptr->update & (PU_LITE))
60606059 {
6061- p_ptr->update &= ~(PU_LITE);
6060+ creature_ptr->update &= ~(PU_LITE);
60626061 update_lite();
60636062 }
60646063
60656064
6066- if (p_ptr->update & (PU_FLOW))
6065+ if (creature_ptr->update & (PU_FLOW))
60676066 {
6068- p_ptr->update &= ~(PU_FLOW);
6067+ creature_ptr->update &= ~(PU_FLOW);
60696068 update_flow();
60706069 }
60716070
6072- if (p_ptr->update & (PU_DISTANCE))
6071+ if (creature_ptr->update & (PU_DISTANCE))
60736072 {
6074- p_ptr->update &= ~(PU_DISTANCE);
6073+ creature_ptr->update &= ~(PU_DISTANCE);
60756074
60766075 /* Still need to call update_monsters(FALSE) after update_mon_lite() */
6077- /* p_ptr->update &= ~(PU_MONSTERS); */
6076+ /* creature_ptr->update &= ~(PU_MONSTERS); */
60786077
60796078 update_monsters(TRUE);
60806079 }
60816080
6082- if (p_ptr->update & (PU_MON_LITE))
6081+ if (creature_ptr->update & (PU_MON_LITE))
60836082 {
6084- p_ptr->update &= ~(PU_MON_LITE);
6083+ creature_ptr->update &= ~(PU_MON_LITE);
60856084 update_mon_lite();
60866085 }
60876086
@@ -6089,15 +6088,15 @@ void update_creature(void)
60896088 * Mega-Hack -- Delayed visual update
60906089 * Only used if update_view(), update_lite() or update_mon_lite() was called
60916090 */
6092- if (p_ptr->update & (PU_DELAY_VIS))
6091+ if (creature_ptr->update & (PU_DELAY_VIS))
60936092 {
6094- p_ptr->update &= ~(PU_DELAY_VIS);
6093+ creature_ptr->update &= ~(PU_DELAY_VIS);
60956094 delayed_visual_update();
60966095 }
60976096
6098- if (p_ptr->update & (PU_MONSTERS))
6097+ if (creature_ptr->update & (PU_MONSTERS))
60996098 {
6100- p_ptr->update &= ~(PU_MONSTERS);
6099+ creature_ptr->update &= ~(PU_MONSTERS);
61016100 update_monsters(FALSE);
61026101 }
61036102 }
Show on old repository browser