summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2012-06-08 17:17:02 +0200
committerBardur Arantsson <bardur@scientician.net>2012-06-08 17:17:02 +0200
commit7573056e431112f1f1c0e513fae36efa06ffaac9 (patch)
tree94d61e65d295108a7b405730f90be4f5a03c1b22
parent41d157bccff5ae75117ea056915099981e338918 (diff)
Lua: Implement new-style HOOK_GET
-rw-r--r--src/object1.c9
-rw-r--r--src/types.h6
2 files changed, 15 insertions, 0 deletions
diff --git a/src/object1.c b/src/object1.c
index 63789794..7d40a8c3 100644
--- a/src/object1.c
+++ b/src/object1.c
@@ -6193,6 +6193,15 @@ void object_pickup(int this_o_idx)
if (process_hooks(HOOK_GET, "(O,d)", o_ptr, this_o_idx))
return;
+ /* Hooks */
+ {
+ hook_get_in in = { o_ptr, this_o_idx };
+ if (process_hooks_new(HOOK_GET, &in, NULL))
+ {
+ return;
+ }
+ }
+
q_ptr = &p_ptr->inventory[INVEN_AMMO];
/* Carry the item */
diff --git a/src/types.h b/src/types.h
index a7d94037..3bbbb270 100644
--- a/src/types.h
+++ b/src/types.h
@@ -2260,6 +2260,12 @@ struct hook_move_in {
int x;
};
+typedef struct hook_get_in hook_get_in;
+struct hook_get_in {
+ object_type *o_ptr;
+ int o_idx;
+};
+
/*
* Structure for the "quests"
*/