diff options
author | Bardur Arantsson <bardur@scientician.net> | 2014-12-19 01:02:33 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2014-12-23 12:07:54 +0100 |
commit | 0ff3645a99ce2ba66e8309c0d34d7a7b2ad5ef51 (patch) | |
tree | 5ecec4265dbc78ed514843d4cc9b6f8b3c85ba97 /src/q_wight.cc | |
parent | 5404247f5adcb64a67bedf8b6442c023c3802a8f (diff) |
Update HOOK_MONSTER_DEATH to new-style hook
Diffstat (limited to 'src/q_wight.cc')
-rw-r--r-- | src/q_wight.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/q_wight.cc b/src/q_wight.cc index 462e0416..573061d7 100644 --- a/src/q_wight.cc +++ b/src/q_wight.cc @@ -105,12 +105,11 @@ static bool_ quest_wight_gen_hook(void *, void *, void *) return TRUE; } -static bool_ quest_wight_death_hook(const char *fmt) +static bool_ quest_wight_death_hook(void *, void *in_, void *) { - s32b r_idx, m_idx; - - m_idx = get_next_arg(fmt); - r_idx = m_list[m_idx].r_idx; + struct hook_monster_death_in *in = static_cast<struct hook_monster_death_in *>(in_); + s32b m_idx = in->m_idx; + s32b r_idx = m_list[m_idx].r_idx; if (p_ptr->inside_quest != QUEST_WIGHT) return FALSE; @@ -122,8 +121,10 @@ static bool_ quest_wight_death_hook(const char *fmt) cave[p_ptr->py][p_ptr->px].special = 0; cquest.status = QUEST_STATUS_COMPLETED; - del_hook(HOOK_MONSTER_DEATH, quest_wight_death_hook); + + del_hook_new(HOOK_MONSTER_DEATH, quest_wight_death_hook); process_hooks_restart = TRUE; + return (FALSE); } @@ -154,7 +155,7 @@ bool_ quest_wight_init_hook(int q_idx) { if ((cquest.status >= QUEST_STATUS_TAKEN) && (cquest.status < QUEST_STATUS_FINISHED)) { - add_hook (HOOK_MONSTER_DEATH, quest_wight_death_hook, "wight_death"); + add_hook_new(HOOK_MONSTER_DEATH, quest_wight_death_hook, "wight_death", NULL); add_hook_new(HOOK_GEN_QUEST, quest_wight_gen_hook, "wight_gen", NULL); add_hook (HOOK_QUEST_FINISH, quest_wight_finish_hook, "wight_finish"); } |