summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/cluautil.h
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2012-04-22 04:21:32 -0400
committerNeil Moore <neil@s-z.org>2012-04-22 04:21:32 -0400
commit21ea1fbfabd30e59ea56fef65b3ee669c39b3798 (patch)
treeb4636270ab42bb899cfd005af86cc5308081da45 /crawl-ref/source/cluautil.h
parentef185ba1f29f90ea611468b98b5046a653fa6cf7 (diff)
downloadcrawl-ref-21ea1fbfabd30e59ea56fef65b3ee669c39b3798.tar.gz
crawl-ref-21ea1fbfabd30e59ea56fef65b3ee669c39b3798.zip
Return multiple items from items.get_items_at().
Like full_describe_view(), we get the extra items from the stash tracker; on untracked levels we can get only the top. Difficulties arise because the stash tracker returns item_defs on the stack where they cannot safely be pointed to. To handle this properly, item_wrapper gains a new boolean member indicating whether the item_def is a temporary copy (as opposed to an element of mitm, for example); a new C function clua_push_item_temp() allocates a copy of an item_def and creates such a wrapper. If the temporary flag is true, the item_def will be freed when the wrapper is GCed.
Diffstat (limited to 'crawl-ref/source/cluautil.h')
-rw-r--r--crawl-ref/source/cluautil.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/crawl-ref/source/cluautil.h b/crawl-ref/source/cluautil.h
index ef725b4f68..9aa5436dae 100644
--- a/crawl-ref/source/cluautil.h
+++ b/crawl-ref/source/cluautil.h
@@ -140,6 +140,7 @@ struct MonsterWrap
// XXX: These are currently defined outside cluautil.cc.
void push_monster(lua_State *ls, monster* mons);
void clua_push_item(lua_State *ls, item_def *item);
+void clua_push_item_temp(lua_State *ls, const item_def &item);
item_def *clua_get_item(lua_State *ls, int ndx);
void lua_push_floor_items(lua_State *ls, int link);
dungeon_feature_type check_lua_feature(lua_State *ls, int idx);