summaryrefslogtreecommitdiff
path: root/src/q_main.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2014-12-18 22:28:59 +0100
committerBardur Arantsson <bardur@scientician.net>2014-12-23 12:07:54 +0100
commit666ce02020925a67386429b451d23071521d6da8 (patch)
tree9369a82a16042186f77210d47d7173780ce5d8e5 /src/q_main.cc
parent132e99238140b1628a2f0175a6edc85358fe8101 (diff)
Update HOOK_CHAR_DUMP to new-style hook
Diffstat (limited to 'src/q_main.cc')
-rw-r--r--src/q_main.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/q_main.cc b/src/q_main.cc
index 3e4e569f..17651da2 100644
--- a/src/q_main.cc
+++ b/src/q_main.cc
@@ -82,14 +82,17 @@ static bool_ quest_morgoth_hook(const char *fmt)
return (FALSE);
}
-static bool_ quest_morgoth_dump_hook(const char *fmt)
+static bool_ quest_morgoth_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_MORGOTH].status >= QUEST_STATUS_COMPLETED)
{
if (quest[QUEST_ONE].status == QUEST_STATUS_FINISHED)
- fprintf(hook_file, "\n You saved Arda and became a famed %s.", sp_ptr->winner);
+ fprintf(f, "\n You saved Arda and became a famed %s.", sp_ptr->winner);
else
- fprintf(hook_file, "\n You became a new force of darkness and enslaved all free people.");
+ fprintf(f, "\n You became a new force of darkness and enslaved all free people.");
}
return (FALSE);
}
@@ -100,8 +103,8 @@ bool_ quest_morgoth_init_hook(int q_idx)
{
add_hook(HOOK_MONSTER_DEATH, quest_morgoth_hook, "morgort_death");
}
- add_hook(HOOK_CHAR_DUMP, quest_morgoth_dump_hook, "morgoth_dump");
- add_hook(HOOK_NEW_MONSTER, quest_main_monsters_hook, "main_new_monster");
+ add_hook_new(HOOK_CHAR_DUMP, quest_morgoth_dump_hook, "morgoth_dump", NULL);
+ add_hook (HOOK_NEW_MONSTER, quest_main_monsters_hook, "main_new_monster");
return (FALSE);
}