diff options
author | Bardur Arantsson <bardur@scientician.net> | 2014-12-18 22:28:59 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2014-12-23 12:07:54 +0100 |
commit | 666ce02020925a67386429b451d23071521d6da8 (patch) | |
tree | 9369a82a16042186f77210d47d7173780ce5d8e5 /src/q_one.cc | |
parent | 132e99238140b1628a2f0175a6edc85358fe8101 (diff) |
Update HOOK_CHAR_DUMP to new-style hook
Diffstat (limited to 'src/q_one.cc')
-rw-r--r-- | src/q_one.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/q_one.cc b/src/q_one.cc index de80afad..cdd0baff 100644 --- a/src/q_one.cc +++ b/src/q_one.cc @@ -300,15 +300,18 @@ static bool_ quest_one_death_hook(const char *fmt) return (FALSE); } -static bool_ quest_one_dump_hook(const char *fmt) +static bool_ quest_one_dump_hook(void *, void *in_, void *) { + struct hook_chardump_in *in = static_cast<struct hook_chardump_in *>(in_); + FILE *f = in->file; + if (cquest.status == QUEST_STATUS_FINISHED) { - fprintf(hook_file, "\n You destroyed the One Ring, thus weakening Sauron."); + fprintf(f, "\n You destroyed the One Ring, thus weakening Sauron."); } if (cquest.status == QUEST_STATUS_FAILED_DONE) { - fprintf(hook_file, "\n You fell under the evil influence of the One Ring and decided to wear it."); + fprintf(f, "\n You fell under the evil influence of the One Ring and decided to wear it."); } return (FALSE); } @@ -358,8 +361,8 @@ bool_ quest_one_init_hook(int q_idx) { add_hook(HOOK_MOVE, quest_one_move_hook, "one_move"); } - add_hook(HOOK_CHAR_DUMP, quest_one_dump_hook, "one_dump"); - add_hook(HOOK_CALC_HP, quest_one_hp_hook, "one_hp"); - add_hook(HOOK_DIE, quest_one_die_hook, "one_die"); + add_hook_new(HOOK_CHAR_DUMP, quest_one_dump_hook, "one_dump", NULL); + add_hook (HOOK_CALC_HP, quest_one_hp_hook, "one_hp"); + add_hook (HOOK_DIE, quest_one_die_hook, "one_die"); return (FALSE); } |