summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2012-06-08 19:36:07 +0200
committerBardur Arantsson <bardur@scientician.net>2012-06-08 19:36:07 +0200
commit4abf66423998e520ea81b6b4e7544a21e313d36b (patch)
treea75de461785ad7e047c3989ab3de8372a680cc4b
parente88d49b8c45f429589018b84b219b80caa66d44b (diff)
Lua: Implement new-style HOOK_PLAYER_LEVEL
-rw-r--r--src/types.h5
-rw-r--r--src/xtra2.c6
2 files changed, 11 insertions, 0 deletions
diff --git a/src/types.h b/src/types.h
index c9727518..82b4890e 100644
--- a/src/types.h
+++ b/src/types.h
@@ -2271,6 +2271,11 @@ struct hook_end_turn_in {
bool_ is_quest;
};
+typedef struct hook_player_level_in hook_player_level_in;
+struct hook_player_level_in {
+ int gained_levels;
+};
+
/*
* Structure for the "quests"
*/
diff --git a/src/xtra2.c b/src/xtra2.c
index d78858b3..1569f442 100644
--- a/src/xtra2.c
+++ b/src/xtra2.c
@@ -2099,7 +2099,13 @@ void check_experience(void)
/* Hook it! */
process_hooks(HOOK_PLAYER_LEVEL, "(d)", gained);
+
+ {
+ hook_player_level_in in = { gained };
+ process_hooks_new(HOOK_PLAYER_LEVEL, &in, NULL);
+ }
}
+
/*
* Advance experience levels and print experience
*/