diff options
author | Bardur Arantsson <bardur@scientician.net> | 2014-12-18 22:46:07 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2014-12-23 12:07:54 +0100 |
commit | dd1e7a5ac938eb75ccbf20ea84954d63511f4611 (patch) | |
tree | e2fde4afc776357d8ac0b8a45844c83fad15993a /src/q_poison.cc | |
parent | abd9033aa9c55ffbc8140d1fbfa28fb585844f47 (diff) |
Update HOOK_DROP to new-style hook
Diffstat (limited to 'src/q_poison.cc')
-rw-r--r-- | src/q_poison.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/q_poison.cc b/src/q_poison.cc index aa03eeab..400f8dde 100644 --- a/src/q_poison.cc +++ b/src/q_poison.cc @@ -171,13 +171,12 @@ static bool_ quest_poison_quest_hook(const char *fmt) return FALSE; } -static bool_ quest_poison_drop_hook(const char *fmt) +static bool_ quest_poison_drop_hook(void *, void *in_, void *) { - s32b mcnt = 0, i, x, y, o_idx; - object_type *o_ptr; - - o_idx = get_next_arg(fmt); - o_ptr = &p_ptr->inventory[o_idx]; + struct hook_drop_in *in = static_cast<struct hook_drop_in *>(in_); + s32b mcnt = 0, i, x, y; + s32b o_idx = in->o_idx; + object_type *o_ptr = &p_ptr->inventory[o_idx]; if (cquest.status != QUEST_STATUS_TAKEN) return FALSE; if (p_ptr->wilderness_y != wild_locs[cquest.data[0]][0]) return FALSE; @@ -212,7 +211,7 @@ static bool_ quest_poison_drop_hook(const char *fmt) cquest.status = QUEST_STATUS_COMPLETED; - del_hook(HOOK_DROP, quest_poison_drop_hook); + del_hook_new(HOOK_DROP, quest_poison_drop_hook); process_hooks_restart = TRUE; return FALSE; @@ -237,7 +236,7 @@ bool_ quest_poison_init_hook(int q_idx) if ((cquest.status >= QUEST_STATUS_TAKEN) && (cquest.status < QUEST_STATUS_FINISHED)) { - add_hook (HOOK_DROP, quest_poison_drop_hook, "poison_drop"); + add_hook_new(HOOK_DROP, quest_poison_drop_hook, "poison_drop", NULL); add_hook_new(HOOK_WILD_GEN, quest_poison_gen_hook, "poison_gen", NULL); add_hook (HOOK_QUEST_FINISH, quest_poison_finish_hook, "poison_finish"); } |