summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/clua.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-04 04:27:08 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-04 04:27:08 +0000
commit396c208cb4e1213a8a7ae02ff30778acfeb4fd1d (patch)
treed03be422618aec7922d585d356c1c8aecba2d5ce /crawl-ref/source/clua.cc
parent0b13d82fe7cd0110aa6383914f2da5a3dc3921a7 (diff)
downloadcrawl-ref-396c208cb4e1213a8a7ae02ff30778acfeb4fd1d.tar.gz
crawl-ref-396c208cb4e1213a8a7ae02ff30778acfeb4fd1d.zip
For stash searching, annotate dropped items with {dropped} if
annotate_item_dropped is set to true. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5466 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/clua.cc')
-rw-r--r--crawl-ref/source/clua.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc
index e9c63be678..237fe16601 100644
--- a/crawl-ref/source/clua.cc
+++ b/crawl-ref/source/clua.cc
@@ -1438,6 +1438,17 @@ static int l_item_weap_skill(lua_State *ls)
return (2);
}
+static int l_item_dropped(lua_State *ls)
+{
+ LUA_ITEM(item, 1);
+ if (!item || !is_valid_item(*item))
+ return (0);
+
+ lua_pushboolean(ls, item->flags & ISFLAG_DROPPED);
+
+ return (1);
+}
+
static int l_item_artefact(lua_State *ls)
{
LUA_ITEM(item, 1);
@@ -1501,6 +1512,7 @@ static const struct luaL_reg item_lib[] =
{ "equipped_at", l_item_equipped },
{ "equip_type", l_item_equip_type },
{ "weap_skill", l_item_weap_skill },
+ { "dropped", l_item_dropped },
{ NULL, NULL },
};