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_thrain.cc | |
parent | 5404247f5adcb64a67bedf8b6442c023c3802a8f (diff) |
Update HOOK_MONSTER_DEATH to new-style hook
Diffstat (limited to 'src/q_thrain.cc')
-rw-r--r-- | src/q_thrain.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/q_thrain.cc b/src/q_thrain.cc index d6cd725a..71c7bfb3 100644 --- a/src/q_thrain.cc +++ b/src/q_thrain.cc @@ -5,14 +5,13 @@ #define cquest (quest[QUEST_THRAIN]) -static bool_ quest_thrain_death_hook(const char *fmt) +static bool_ quest_thrain_death_hook(void *, void *in_, void *) { - s32b m_idx; + struct hook_monster_death_in *in = static_cast<struct hook_monster_death_in *>(in_); + s32b m_idx = in->m_idx; int r, x, y; monster_type *m_ptr; - m_idx = get_next_arg(fmt); - if ((cquest.status >= QUEST_STATUS_FINISHED) || (dun_level !=cquest.data[0]) || (dungeon_type != DUNGEON_DOL_GULDUR)) return (FALSE); m_ptr = &m_list[m_idx]; if ((m_ptr->r_idx != test_monster_name("Dwar, Dog Lord of Waw")) && (m_ptr->r_idx != test_monster_name("Hoarmurath of Dir"))) return (FALSE); @@ -85,7 +84,7 @@ static bool_ quest_thrain_death_hook(const char *fmt) } - del_hook(HOOK_MONSTER_DEATH, quest_thrain_death_hook); + del_hook_new(HOOK_MONSTER_DEATH, quest_thrain_death_hook); process_hooks_restart = TRUE; return (FALSE); @@ -232,7 +231,7 @@ bool_ quest_thrain_init_hook(int q) add_hook (HOOK_NEW_LEVEL, quest_thrain_turn_hook, "thrain_new_lvl"); add_hook (HOOK_BUILD_ROOM1, quest_thrain_gen_hook, "thrain_gen"); add_hook_new(HOOK_FEELING, quest_thrain_feeling_hook, "thrain_feel", NULL); - add_hook (HOOK_MONSTER_DEATH, quest_thrain_death_hook, "thrain_death"); + add_hook_new(HOOK_MONSTER_DEATH, quest_thrain_death_hook, "thrain_death", NULL); } return (FALSE); } |