• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionb20404591c4523ed5aee38adb1c5de33d36acfae (tree)
Time2019-06-23 14:27:29
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-quaff.c
+++ b/src/cmd-quaff.c
@@ -254,7 +254,7 @@ void exe_quaff_potion(INVENTORY_IDX item)
254254 break;
255255
256256 case SV_POTION_INFRAVISION:
257- if (set_tim_infra(p_ptr->tim_infra + 100 + randint1(100), FALSE))
257+ if (set_tim_infra(p_ptr, p_ptr->tim_infra + 100 + randint1(100), FALSE))
258258 {
259259 ident = TRUE;
260260 }
--- a/src/core.c
+++ b/src/core.c
@@ -1863,7 +1863,7 @@ static void process_world_aux_timeout(void)
18631863 /* Timed infra-vision */
18641864 if (p_ptr->tim_infra)
18651865 {
1866- (void)set_tim_infra(p_ptr->tim_infra - 1, TRUE);
1866+ (void)set_tim_infra(p_ptr, p_ptr->tim_infra - 1, TRUE);
18671867 }
18681868
18691869 /* Timed stealth */
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -310,7 +310,7 @@ void dispel_player(void)
310310 (void)set_dustrobe(0,TRUE);
311311
312312 (void)set_tim_invis(p_ptr, 0, TRUE);
313- (void)set_tim_infra(0, TRUE);
313+ (void)set_tim_infra(p_ptr, 0, TRUE);
314314 (void)set_tim_esp(0, TRUE);
315315 (void)set_tim_regen(0, TRUE);
316316 (void)set_tim_stealth(0, TRUE);
@@ -1530,21 +1530,21 @@ bool set_tim_invis(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
15301530 * @param do_dec 現在の継続時間より長い値のみ上書きする
15311531 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
15321532 */
1533-bool set_tim_infra(TIME_EFFECT v, bool do_dec)
1533+bool set_tim_infra(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
15341534 {
15351535 bool notice = FALSE;
15361536 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
15371537
1538- if (p_ptr->is_dead) return FALSE;
1538+ if (creature_ptr->is_dead) return FALSE;
15391539
15401540 /* Open */
15411541 if (v)
15421542 {
1543- if (p_ptr->tim_infra && !do_dec)
1543+ if (creature_ptr->tim_infra && !do_dec)
15441544 {
1545- if (p_ptr->tim_infra > v) return FALSE;
1545+ if (creature_ptr->tim_infra > v) return FALSE;
15461546 }
1547- else if (!p_ptr->tim_infra)
1547+ else if (!creature_ptr->tim_infra)
15481548 {
15491549 msg_print(_("目がランランと輝き始めた!", "Your eyes begin to tingle!"));
15501550 notice = TRUE;
@@ -1554,7 +1554,7 @@ bool set_tim_infra(TIME_EFFECT v, bool do_dec)
15541554 /* Shut */
15551555 else
15561556 {
1557- if (p_ptr->tim_infra)
1557+ if (creature_ptr->tim_infra)
15581558 {
15591559 msg_print(_("目の輝きがなくなった。", "Your eyes stop tingling."));
15601560 notice = TRUE;
@@ -1562,17 +1562,17 @@ bool set_tim_infra(TIME_EFFECT v, bool do_dec)
15621562 }
15631563
15641564 /* Use the value */
1565- p_ptr->tim_infra = v;
1566- p_ptr->redraw |= (PR_STATUS);
1565+ creature_ptr->tim_infra = v;
1566+ creature_ptr->redraw |= (PR_STATUS);
15671567
15681568 /* Nothing to notice */
15691569 if (!notice) return (FALSE);
15701570
15711571 if (disturb_state) disturb(FALSE, FALSE);
1572- p_ptr->update |= (PU_BONUS);
1572+ creature_ptr->update |= (PU_BONUS);
15731573
15741574 /* Update the monsters */
1575- p_ptr->update |= (PU_MONSTERS);
1575+ creature_ptr->update |= (PU_MONSTERS);
15761576 handle_stuff();
15771577 return (TRUE);
15781578 }
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -32,7 +32,7 @@ extern bool set_shero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3232 extern bool set_protevil(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3333 extern bool set_invuln(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3434 extern bool set_tim_invis(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
35-extern bool set_tim_infra(TIME_EFFECT v, bool do_dec);
35+extern bool set_tim_infra(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3636 extern bool set_tim_regen(TIME_EFFECT v, bool do_dec);
3737 extern bool set_tim_stealth(TIME_EFFECT v, bool do_dec);
3838 extern bool set_lightspeed(TIME_EFFECT v, bool do_dec);
--- a/src/realm-craft.c
+++ b/src/realm-craft.c
@@ -41,7 +41,7 @@ concptr do_craft_spell(SPELL_IDX spell, BIT_FLAGS mode)
4141
4242 if (cast)
4343 {
44- set_tim_infra(base + randint1(base), FALSE);
44+ set_tim_infra(p_ptr, base + randint1(base), FALSE);
4545 }
4646 }
4747 break;
Show on old repository browser