• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision327db4428c3cc421b65b4b4294bde8ac97229cbc (tree)
Time2019-07-10 00:04:04
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 calc_torch() に player_type * 引数を追加.

Change Summary

Incremental Difference

--- a/src/player-status.c
+++ b/src/player-status.c
@@ -4095,7 +4095,7 @@ static void calc_hitpoints(player_type *creature_ptr)
40954095 * @details
40964096 * SWD: Experimental modification: multiple light sources have additive effect.
40974097 */
4098-static void calc_torch(void)
4098+static void calc_torch(player_type *creature_ptr)
40994099 {
41004100 int i;
41014101 POSITION rad;
@@ -4103,16 +4103,16 @@ static void calc_torch(void)
41034103 BIT_FLAGS flgs[TR_FLAG_SIZE];
41044104
41054105 /* Assume no light */
4106- p_ptr->cur_lite = 0;
4106+ creature_ptr->cur_lite = 0;
41074107
41084108 /* Loop through all wielded items */
41094109 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
41104110 {
4111- o_ptr = &p_ptr->inventory_list[i];
4111+ o_ptr = &creature_ptr->inventory_list[i];
41124112 /* Skip empty slots */
41134113 if (!o_ptr->k_idx) continue;
41144114
4115- if (o_ptr->name2 == EGO_LITE_SHINE) p_ptr->cur_lite++;
4115+ if (o_ptr->name2 == EGO_LITE_SHINE) creature_ptr->cur_lite++;
41164116
41174117 /* Need Fuels */
41184118 if (o_ptr->name2 != EGO_LITE_DARKNESS)
@@ -4134,35 +4134,35 @@ static void calc_torch(void)
41344134 if (have_flag(flgs, TR_LITE_M1)) rad -= 1;
41354135 if (have_flag(flgs, TR_LITE_M2)) rad -= 2;
41364136 if (have_flag(flgs, TR_LITE_M3)) rad -= 3;
4137- p_ptr->cur_lite += rad;
4137+ creature_ptr->cur_lite += rad;
41384138 }
41394139
41404140 /* max radius is 14 (was 5) without rewriting other code -- */
4141- if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS && p_ptr->cur_lite > 1)
4142- p_ptr->cur_lite = 1;
4141+ if (d_info[creature_ptr->dungeon_idx].flags1 & DF1_DARKNESS && creature_ptr->cur_lite > 1)
4142+ creature_ptr->cur_lite = 1;
41434143
41444144 /*
41454145 * check if the player doesn't have light radius,
41464146 * but does weakly glow as an intrinsic.
41474147 */
4148- if (p_ptr->cur_lite <= 0 && p_ptr->lite) p_ptr->cur_lite++;
4148+ if (creature_ptr->cur_lite <= 0 && creature_ptr->lite) creature_ptr->cur_lite++;
41494149
4150- if (p_ptr->cur_lite > 14) p_ptr->cur_lite = 14;
4151- if (p_ptr->cur_lite < 0) p_ptr->cur_lite = 0;
4150+ if (creature_ptr->cur_lite > 14) creature_ptr->cur_lite = 14;
4151+ if (creature_ptr->cur_lite < 0) creature_ptr->cur_lite = 0;
41524152
41534153 /* end experimental mods */
41544154
41554155 /* Notice changes in the "lite radius" */
4156- if (p_ptr->old_lite != p_ptr->cur_lite)
4156+ if (creature_ptr->old_lite != creature_ptr->cur_lite)
41574157 {
41584158 /* Hack -- PU_MON_LITE for monsters' darkness */
4159- p_ptr->update |= (PU_LITE | PU_MON_LITE | PU_MONSTERS);
4159+ creature_ptr->update |= (PU_LITE | PU_MON_LITE | PU_MONSTERS);
41604160
41614161 /* Remember the old lite */
4162- p_ptr->old_lite = p_ptr->cur_lite;
4162+ creature_ptr->old_lite = creature_ptr->cur_lite;
41634163
4164- if ((p_ptr->cur_lite > 0) && (p_ptr->special_defense & NINJA_S_STEALTH))
4165- set_superstealth(p_ptr, FALSE);
4164+ if ((creature_ptr->cur_lite > 0) && (creature_ptr->special_defense & NINJA_S_STEALTH))
4165+ set_superstealth(creature_ptr, FALSE);
41664166 }
41674167 }
41684168
@@ -5014,7 +5014,7 @@ void update_creature(player_type *creature_ptr)
50145014 if (creature_ptr->update & (PU_TORCH))
50155015 {
50165016 creature_ptr->update &= ~(PU_TORCH);
5017- calc_torch();
5017+ calc_torch(creature_ptr);
50185018 }
50195019
50205020 if (creature_ptr->update & (PU_HP))
Show on old repository browser