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_ultrag.cc | |
parent | 132e99238140b1628a2f0175a6edc85358fe8101 (diff) |
Update HOOK_CHAR_DUMP to new-style hook
Diffstat (limited to 'src/q_ultrag.cc')
-rw-r--r-- | src/q_ultrag.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/q_ultrag.cc b/src/q_ultrag.cc index 504fb775..cddacda4 100644 --- a/src/q_ultrag.cc +++ b/src/q_ultrag.cc @@ -234,23 +234,26 @@ static bool_ quest_ultra_good_death_hook(const char *fmt) return (FALSE); } -static bool_ quest_ultra_good_dump_hook(const char *fmt) +static bool_ quest_ultra_good_dump_hook(void *, void *in_, void *) { + struct hook_chardump_in *in = static_cast<struct hook_chardump_in *>(in_); + FILE *f = in->file; + if (quest[QUEST_ULTRA_GOOD].status >= QUEST_STATUS_TAKEN) { /* Ultra winner ! */ if (total_winner == WINNER_ULTRA) { - fprintf(hook_file, "\n You destroyed Melkor forever and have been elevated to the status of Vala by Eru Iluvatar."); - fprintf(hook_file, "\n Arda will forever be free."); + fprintf(f, "\n You destroyed Melkor forever and have been elevated to the status of Vala by Eru Iluvatar."); + fprintf(f, "\n Arda will forever be free."); } else { /* Tried and failed */ if (death) { - fprintf(hook_file, "\n You tried to destroy Melkor forever, but died in the attempt."); - fprintf(hook_file, "\n Arda will be quiet, but not free from evil."); + fprintf(f, "\n You tried to destroy Melkor forever, but died in the attempt."); + fprintf(f, "\n Arda will be quiet, but not free from evil."); } } } @@ -270,6 +273,6 @@ bool_ quest_ultra_good_init_hook(int q) { add_hook(HOOK_MOVE, quest_ultra_good_move_hook, "ultrag_move"); } - add_hook(HOOK_CHAR_DUMP, quest_ultra_good_dump_hook, "ultrag_dump"); + add_hook_new(HOOK_CHAR_DUMP, quest_ultra_good_dump_hook, "ultrag_dump", NULL); return (FALSE); } |