From 9f093f959a05f5aed18dc9b59c0038409cef8c67 Mon Sep 17 00:00:00 2001 From: deskull Date: Sat, 29 Jun 2019 19:07:10 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#38997=20set=5Faction()=20=E3=81=AB?= =?utf8?q?=20player=5Ftype=20*=20=E5=BC=95=E6=95=B0=E3=82=92=E8=BF=BD?= =?utf8?q?=E5=8A=A0=EF=BC=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/cmd-activate.c | 2 +- src/cmd-basic.c | 28 ++++++++++++++-------------- src/cmd-eat.c | 2 +- src/cmd-hissatsu.c | 4 ++-- src/cmd-item.c | 12 ++++++------ src/cmd-pet.c | 4 ++-- src/cmd-quaff.c | 2 +- src/cmd-read.c | 2 +- src/cmd-spell.c | 4 ++-- src/cmd-usestaff.c | 2 +- src/cmd-zaprod.c | 2 +- src/cmd-zapwand.c | 2 +- src/core.c | 16 ++++++++-------- src/melee1.c | 4 ++-- src/player-effects.c | 32 ++++++++++++++++---------------- src/player-effects.h | 2 +- src/player-move.c | 4 ++-- src/player-status.c | 2 +- src/racial.c | 14 +++++++------- src/realm-hex.c | 6 +++--- src/realm-song.c | 2 +- src/spells-status.c | 6 +++--- src/spells2.c | 4 ++-- src/wild.c | 2 +- 24 files changed, 80 insertions(+), 80 deletions(-) diff --git a/src/cmd-activate.c b/src/cmd-activate.c index 1ce82e350..d5367ac50 100644 --- a/src/cmd-activate.c +++ b/src/cmd-activate.c @@ -640,7 +640,7 @@ void do_cmd_activate(player_type *user_ptr) if (user_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN)) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } item_tester_hook = item_tester_hook_activate; diff --git a/src/cmd-basic.c b/src/cmd-basic.c index 7a7129430..0997e4580 100644 --- a/src/cmd-basic.c +++ b/src/cmd-basic.c @@ -195,7 +195,7 @@ void do_cmd_go_up(player_type *creature_ptr) if (creature_ptr->special_defense & KATA_MUSOU) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } /* Verify stairs */ @@ -333,7 +333,7 @@ void do_cmd_go_down(player_type *creature_ptr) if (creature_ptr->special_defense & KATA_MUSOU) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } /* Verify stairs */ @@ -830,7 +830,7 @@ void do_cmd_open(player_type *creature_ptr) if (creature_ptr->special_defense & KATA_MUSOU) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } /* Option: Pick a direction */ @@ -974,7 +974,7 @@ void do_cmd_close(void) if (p_ptr->special_defense & KATA_MUSOU) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } /* Option: Pick a direction */ @@ -1219,7 +1219,7 @@ void do_cmd_tunnel(void) if (p_ptr->special_defense & KATA_MUSOU) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } /* Allow repeated command */ @@ -1552,7 +1552,7 @@ void do_cmd_disarm(void) if (p_ptr->special_defense & KATA_MUSOU) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } /* Option: Pick a direction */ @@ -1752,7 +1752,7 @@ void do_cmd_bash(void) if (p_ptr->special_defense & KATA_MUSOU) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } /* Allow repeated command */ @@ -1834,7 +1834,7 @@ void do_cmd_alter(void) if (p_ptr->special_defense & KATA_MUSOU) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } /* Allow repeated command */ @@ -1964,7 +1964,7 @@ void do_cmd_spike(void) if (p_ptr->special_defense & KATA_MUSOU) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } /* Get a "repeated" direction */ @@ -2055,7 +2055,7 @@ void do_cmd_walk(bool pickup) if ((dir != 5) && (p_ptr->special_defense & KATA_MUSOU)) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } /* Hack -- In small scale wilderness it takes MUCH more time to move */ @@ -2108,7 +2108,7 @@ void do_cmd_run(void) if (p_ptr->special_defense & KATA_MUSOU) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } /* Get a "repeated" direction */ @@ -2160,7 +2160,7 @@ void do_cmd_stay(bool pickup) void do_cmd_rest(void) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); if ((p_ptr->pclass == CLASS_BARD) && (SINGING_SONG_EFFECT(p_ptr) || INTERUPTING_SONG_EFFECT(p_ptr))) { @@ -2282,7 +2282,7 @@ void do_cmd_fire(SPELL_IDX snipe_type) if (p_ptr->special_defense & KATA_MUSOU) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } q = _("どれを撃ちますか? ", "Fire which item? "); @@ -2364,7 +2364,7 @@ bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken) if (p_ptr->special_defense & KATA_MUSOU) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } if (shuriken >= 0) diff --git a/src/cmd-eat.c b/src/cmd-eat.c index 419e71b80..1afe7eb38 100644 --- a/src/cmd-eat.c +++ b/src/cmd-eat.c @@ -512,7 +512,7 @@ void do_cmd_eat_food(void) if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN)) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } /* Restrict choices to food */ diff --git a/src/cmd-hissatsu.c b/src/cmd-hissatsu.c index 79988981d..cc51db0a3 100644 --- a/src/cmd-hissatsu.c +++ b/src/cmd-hissatsu.c @@ -333,7 +333,7 @@ void do_cmd_hissatsu(void) if (p_ptr->special_defense & KATA_MASK) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } if (!get_hissatsu_power(&n)) return; @@ -382,7 +382,7 @@ void do_cmd_gain_hissatsu(void) if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN)) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } if (p_ptr->blind || no_lite()) diff --git a/src/cmd-item.c b/src/cmd-item.c index 9ad4c4b64..f36e0532e 100644 --- a/src/cmd-item.c +++ b/src/cmd-item.c @@ -181,7 +181,7 @@ void do_cmd_wield(void) if (p_ptr->special_defense & KATA_MUSOU) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } /* Restrict the choices */ @@ -531,7 +531,7 @@ void do_cmd_takeoff(void) if (p_ptr->special_defense & KATA_MUSOU) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } q = _("どれを装備からはずしますか? ", "Take off which item? "); @@ -596,7 +596,7 @@ void do_cmd_drop(void) if (p_ptr->special_defense & KATA_MUSOU) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } q = _("どのアイテムを落としますか? ", "Drop which item? "); @@ -656,7 +656,7 @@ void do_cmd_destroy(void) if (p_ptr->special_defense & KATA_MUSOU) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } /* Hack -- force destruction */ @@ -1100,7 +1100,7 @@ void do_cmd_refill(void) if (p_ptr->special_defense & KATA_MUSOU) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } /* It is nothing */ @@ -1529,7 +1529,7 @@ void do_cmd_use(void) if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN)) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } item_tester_hook = item_tester_hook_use; diff --git a/src/cmd-pet.c b/src/cmd-pet.c index c493f4e98..7863dc041 100644 --- a/src/cmd-pet.c +++ b/src/cmd-pet.c @@ -285,7 +285,7 @@ bool do_riding(bool force) x = p_ptr->x + ddx[dir]; g_ptr = ¤t_floor_ptr->grid_array[y][x]; - if (p_ptr->special_defense & KATA_MUSOU) set_action(ACTION_NONE); + if (p_ptr->special_defense & KATA_MUSOU) set_action(p_ptr, ACTION_NONE); if (p_ptr->riding) { @@ -369,7 +369,7 @@ bool do_riding(bool force) msg_format(_("%sを起こした。", "You have waked %s up."), m_name); } - if (p_ptr->action == ACTION_KAMAE) set_action(ACTION_NONE); + if (p_ptr->action == ACTION_KAMAE) set_action(p_ptr, ACTION_NONE); p_ptr->riding = g_ptr->m_idx; diff --git a/src/cmd-quaff.c b/src/cmd-quaff.c index 505bc80ed..2753d0cec 100644 --- a/src/cmd-quaff.c +++ b/src/cmd-quaff.c @@ -610,7 +610,7 @@ void do_cmd_quaff_potion(void) if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN)) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } /* Restrict choices to potions */ diff --git a/src/cmd-read.c b/src/cmd-read.c index bebd676b8..ac4a763db 100644 --- a/src/cmd-read.c +++ b/src/cmd-read.c @@ -632,7 +632,7 @@ void do_cmd_read_scroll(void) if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN)) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } if (cmd_limit_blind(p_ptr)) return; diff --git a/src/cmd-spell.c b/src/cmd-spell.c index bd1062458..9c8770196 100644 --- a/src/cmd-spell.c +++ b/src/cmd-spell.c @@ -651,7 +651,7 @@ void do_cmd_browse(void) if (p_ptr->special_defense & KATA_MUSOU) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } if (p_ptr->pclass == CLASS_FORCETRAINER) @@ -829,7 +829,7 @@ void do_cmd_study(void) if (p_ptr->special_defense & KATA_MUSOU) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } #ifdef JP diff --git a/src/cmd-usestaff.c b/src/cmd-usestaff.c index 64a340afb..2ad7712a9 100644 --- a/src/cmd-usestaff.c +++ b/src/cmd-usestaff.c @@ -440,7 +440,7 @@ void do_cmd_use_staff(void) if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN)) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } q = _("どの杖を使いますか? ", "Use which staff? "); diff --git a/src/cmd-zaprod.c b/src/cmd-zaprod.c index b590d5212..e0bc2c2b5 100644 --- a/src/cmd-zaprod.c +++ b/src/cmd-zaprod.c @@ -412,7 +412,7 @@ void do_cmd_zap_rod(void) if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN)) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } q = _("どのロッドを振りますか? ", "Zap which rod? "); diff --git a/src/cmd-zapwand.c b/src/cmd-zapwand.c index b1cde686c..9139e3c04 100644 --- a/src/cmd-zapwand.c +++ b/src/cmd-zapwand.c @@ -463,7 +463,7 @@ void do_cmd_aim_wand(void) if (cmd_limit_arena(p_ptr)) return; if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN)) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } q = _("どの魔法棒で狙いますか? ", "Aim which wand? "); diff --git a/src/core.c b/src/core.c index 5927c8e27..1cc079946 100644 --- a/src/core.c +++ b/src/core.c @@ -3715,8 +3715,8 @@ static void process_command(void) /* Toggle search mode */ case 'S': { - if (p_ptr->action == ACTION_SEARCH) set_action(ACTION_NONE); - else set_action(ACTION_SEARCH); + if (p_ptr->action == ACTION_SEARCH) set_action(p_ptr, ACTION_NONE); + else set_action(p_ptr, ACTION_SEARCH); break; } @@ -4274,7 +4274,7 @@ static void process_command(void) if (!p_ptr->wild_mode) do_cmd_travel(); if (p_ptr->special_defense & KATA_MUSOU) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } break; } @@ -4466,7 +4466,7 @@ static void process_player(void) if ((p_ptr->chp == p_ptr->mhp) && (p_ptr->csp >= p_ptr->msp)) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } } @@ -4483,7 +4483,7 @@ static void process_player(void) !p_ptr->image && !p_ptr->word_recall && !p_ptr->alter_reality) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } } } @@ -4592,7 +4592,7 @@ static void process_player(void) /* Mana run out */ p_ptr->csp = 0; p_ptr->csp_frac = 0; - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } else { @@ -4608,7 +4608,7 @@ static void process_player(void) { if (p_ptr->csp < 3) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } else { @@ -4671,7 +4671,7 @@ static void process_player(void) /* Reduce rest count */ p_ptr->resting--; - if (!p_ptr->resting) set_action(ACTION_NONE); + if (!p_ptr->resting) set_action(p_ptr, ACTION_NONE); p_ptr->redraw |= (PR_STATE); } diff --git a/src/melee1.c b/src/melee1.c index 59dcadb65..db5575aaa 100644 --- a/src/melee1.c +++ b/src/melee1.c @@ -2343,7 +2343,7 @@ bool py_attack(POSITION y, POSITION x, COMBAT_OPTION_IDX mode) if ((p_ptr->special_defense & KATA_IAI) && ((mode != HISSATSU_IAI) || mdeath)) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } return mdeath; @@ -4108,7 +4108,7 @@ bool make_attack_normal(MONSTER_IDX m_idx) if (p_ptr->special_defense & KATA_IAI) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } /* Assume we attacked */ diff --git a/src/player-effects.c b/src/player-effects.c index 1151b3417..d839087cd 100644 --- a/src/player-effects.c +++ b/src/player-effects.c @@ -99,9 +99,9 @@ const kamae kata_shurui[MAX_KATA] = * #ACTION_NONE / #ACTION_SEARCH / #ACTION_REST / #ACTION_LEARN / #ACTION_FISH / #ACTION_KAMAE / #ACTION_KATA / #ACTION_SING / #ACTION_HAYAGAKE / #ACTION_SPELL から選択。 * @return なし */ -void set_action(ACTION_IDX typ) +void set_action(player_type *creature_ptr, ACTION_IDX typ) { - int prev_typ = p_ptr->action; + int prev_typ = creature_ptr->action; if (typ == prev_typ) { @@ -114,32 +114,32 @@ void set_action(ACTION_IDX typ) case ACTION_SEARCH: { msg_print(_("探索をやめた。", "You no longer walk carefully.")); - p_ptr->redraw |= (PR_SPEED); + creature_ptr->redraw |= (PR_SPEED); break; } case ACTION_REST: { - p_ptr->resting = 0; + creature_ptr->resting = 0; break; } case ACTION_LEARN: { msg_print(_("学習をやめた。", "You stop Learning")); - p_ptr->new_mane = FALSE; + creature_ptr->new_mane = FALSE; break; } case ACTION_KAMAE: { msg_print(_("構えをといた。", "You stop assuming the posture.")); - p_ptr->special_defense &= ~(KAMAE_MASK); + creature_ptr->special_defense &= ~(KAMAE_MASK); break; } case ACTION_KATA: { msg_print(_("型を崩した。", "You stop assuming the posture.")); - p_ptr->special_defense &= ~(KATA_MASK); - p_ptr->update |= (PU_MONSTERS); - p_ptr->redraw |= (PR_STATUS); + creature_ptr->special_defense &= ~(KATA_MASK); + creature_ptr->update |= (PU_MONSTERS); + creature_ptr->redraw |= (PR_STATUS); break; } case ACTION_SING: @@ -150,7 +150,7 @@ void set_action(ACTION_IDX typ) case ACTION_HAYAGAKE: { msg_print(_("足が重くなった。", "You are no longer walking extremely fast.")); - take_turn(p_ptr, 100); + take_turn(creature_ptr, 100); break; } case ACTION_SPELL: @@ -161,18 +161,18 @@ void set_action(ACTION_IDX typ) } } - p_ptr->action = typ; + creature_ptr->action = typ; /* If we are requested other action, stop singing */ - if (prev_typ == ACTION_SING) stop_singing(p_ptr); + if (prev_typ == ACTION_SING) stop_singing(creature_ptr); if (prev_typ == ACTION_SPELL) stop_hex_spell(); - switch (p_ptr->action) + switch (creature_ptr->action) { case ACTION_SEARCH: { msg_print(_("注意深く歩き始めた。", "You begin to walk carefully.")); - p_ptr->redraw |= (PR_SPEED); + creature_ptr->redraw |= (PR_SPEED); break; } case ACTION_LEARN: @@ -195,8 +195,8 @@ void set_action(ACTION_IDX typ) break; } } - p_ptr->update |= (PU_BONUS); - p_ptr->redraw |= (PR_STATE); + creature_ptr->update |= (PU_BONUS); + creature_ptr->redraw |= (PR_STATE); } /*! diff --git a/src/player-effects.h b/src/player-effects.h index 0fab58a9c..a17f2028e 100644 --- a/src/player-effects.h +++ b/src/player-effects.h @@ -11,7 +11,7 @@ struct kamae /* effects.c */ -extern void set_action(ACTION_IDX typ); +extern void set_action(player_type *creature_ptr, ACTION_IDX typ); extern void reset_tim_flags(player_type *creature_ptr); extern void dispel_player(player_type *creature_ptr); extern bool set_mimic(player_type *creature_ptr, TIME_EFFECT v, IDX p, bool do_dec); diff --git a/src/player-move.c b/src/player-move.c index 94e2be3a4..a93d15187 100644 --- a/src/player-move.c +++ b/src/player-move.c @@ -677,7 +677,7 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode) (!p_ptr->levitation && have_flag(f_ptr->flags, FF_DEEP)))) { msg_print(_("ここでは素早く動けない。", "You cannot run in here.")); - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } if (p_ptr->prace == RACE_MERFOLK) { @@ -2297,7 +2297,7 @@ void disturb(bool stop_search, bool stop_travel) if ((p_ptr->action == ACTION_REST) || (p_ptr->action == ACTION_FISH) || (stop_search && (p_ptr->action == ACTION_SEARCH))) { /* Cancel */ - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } /* Cancel running */ diff --git a/src/player-status.c b/src/player-status.c index 255b28a6b..7c1c321a5 100644 --- a/src/player-status.c +++ b/src/player-status.c @@ -1615,7 +1615,7 @@ void calc_bonuses(void) { if (!(empty_hands_status & EMPTY_HAND_RARM)) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } } diff --git a/src/racial.c b/src/racial.c index 6ede7c96f..caed1cc4d 100644 --- a/src/racial.c +++ b/src/racial.c @@ -78,7 +78,7 @@ static bool choose_kamae(void) { if (p_ptr->action == ACTION_KAMAE) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } else msg_print(_("もともと構えていない。", "You are not assuming a posture.")); @@ -106,7 +106,7 @@ static bool choose_kamae(void) break; } } - set_action(ACTION_KAMAE); + set_action(p_ptr, ACTION_KAMAE); if (p_ptr->special_defense & (KAMAE_GENBU << new_kamae)) { @@ -177,7 +177,7 @@ static bool choose_kata(void) { if (p_ptr->action == ACTION_KATA) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } else msg_print(_("もともと構えていない。", "You are not assuming posture.")); @@ -205,7 +205,7 @@ static bool choose_kata(void) break; } } - set_action(ACTION_KATA); + set_action(p_ptr, ACTION_KATA); if (p_ptr->special_defense & (KATA_IAI << new_kata)) { @@ -579,11 +579,11 @@ static bool cmd_racial_power_aux(s32b command) { if (p_ptr->action == ACTION_LEARN) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } else { - set_action(ACTION_LEARN); + set_action(p_ptr, ACTION_LEARN); } free_turn(p_ptr); break; @@ -855,7 +855,7 @@ void do_cmd_racial_power(void) if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN)) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } switch (p_ptr->pclass) diff --git a/src/realm-hex.c b/src/realm-hex.c index 124fbb2a3..d221ccd2b 100644 --- a/src/realm-hex.c +++ b/src/realm-hex.c @@ -54,7 +54,7 @@ bool stop_hex_spell_all(void) CASTING_HEX_FLAGS(p_ptr) = 0; CASTING_HEX_NUM(p_ptr) = 0; - if (p_ptr->action == ACTION_SPELL) set_action(ACTION_NONE); + if (p_ptr->action == ACTION_SPELL) set_action(p_ptr, ACTION_NONE); p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS); p_ptr->redraw |= (PR_EXTRA | PR_HP | PR_MANA); @@ -824,7 +824,7 @@ concptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode) do_spell(REALM_HEX, spell, SPELL_STOP); CASTING_HEX_FLAGS(p_ptr) &= ~(1L << spell); CASTING_HEX_NUM(p_ptr)--; - if (!SINGING_SONG_ID(p_ptr)) set_action(ACTION_NONE); + if (!SINGING_SONG_ID(p_ptr)) set_action(p_ptr, ACTION_NONE); } } if (stop) @@ -1122,7 +1122,7 @@ concptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode) CASTING_HEX_FLAGS(p_ptr) |= 1L << (spell); CASTING_HEX_NUM(p_ptr)++; - if (p_ptr->action != ACTION_SPELL) set_action(ACTION_SPELL); + if (p_ptr->action != ACTION_SPELL) set_action(p_ptr, ACTION_SPELL); } if (!info) diff --git a/src/realm-song.c b/src/realm-song.c index dc59f69d4..752057799 100644 --- a/src/realm-song.c +++ b/src/realm-song.c @@ -27,7 +27,7 @@ static void start_singing(SPELL_IDX spell, MAGIC_NUM1 song) /* Now the player is singing */ - set_action(ACTION_SING); + set_action(p_ptr, ACTION_SING); p_ptr->update |= (PU_BONUS); p_ptr->redraw |= (PR_STATUS); diff --git a/src/spells-status.c b/src/spells-status.c index 0e482ce52..e897d0c67 100644 --- a/src/spells-status.c +++ b/src/spells-status.c @@ -169,8 +169,8 @@ void stop_singing(player_type *creature_ptr) /* The player is singing? */ if (!SINGING_SONG_EFFECT(creature_ptr)) return; - /* Hack -- if called from set_action(), avoid recursive loop */ - if (creature_ptr->action == ACTION_SING) set_action(ACTION_NONE); + /* Hack -- if called from set_action(p_ptr, ), avoid recursive loop */ + if (creature_ptr->action == ACTION_SING) set_action(p_ptr, ACTION_NONE); /* Message text of each song or etc. */ do_spell(REALM_MUSIC, SINGING_SONG_ID(creature_ptr), SPELL_STOP); @@ -426,7 +426,7 @@ bool fishing(player_type *creature_ptr) free_turn(creature_ptr); return FALSE; } - set_action(ACTION_FISH); + set_action(p_ptr, ACTION_FISH); creature_ptr->redraw |= (PR_STATE); return TRUE; } diff --git a/src/spells2.c b/src/spells2.c index 81c71e6b2..3b86942e5 100644 --- a/src/spells2.c +++ b/src/spells2.c @@ -4211,7 +4211,7 @@ void hayagake(player_type *creature_ptr) { if (creature_ptr->action == ACTION_HAYAGAKE) { - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); } else { @@ -4225,7 +4225,7 @@ void hayagake(player_type *creature_ptr) } else { - set_action(ACTION_HAYAGAKE); + set_action(p_ptr, ACTION_HAYAGAKE); } } creature_ptr->energy_use = 0; diff --git a/src/wild.c b/src/wild.c index 564fdd8c7..d5b48c02a 100644 --- a/src/wild.c +++ b/src/wild.c @@ -1181,7 +1181,7 @@ bool change_wild_mode(bool encount) if (hex_spelling_any()) stop_hex_spell_all(); /* Cancel any special action */ - set_action(ACTION_NONE); + set_action(p_ptr, ACTION_NONE); /* Go into the global map */ p_ptr->wild_mode = TRUE; -- 2.11.0