summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/items.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/items.cc')
-rw-r--r--crawl-ref/source/items.cc22
1 files changed, 21 insertions, 1 deletions
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index f97806f52e..40f43c7358 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -748,7 +748,6 @@ static int item_name_specialness(const item_def& item)
void item_check(bool verbose)
{
-
describe_floor();
origin_set(you.x_pos, you.y_pos);
@@ -2344,6 +2343,27 @@ int inv_count(void)
return count;
}
+item_def *find_floor_item(object_class_type cls, int sub_type)
+{
+ int item = NON_ITEM;
+ for (int y = 0; y < GYM; ++y)
+ for (int x = 0; x < GXM; ++x)
+ {
+ item = igrd[x][y];
+ while (item != NON_ITEM)
+ {
+ item_def &i(mitm[item]);
+
+ if (is_valid_item(i) && i.base_type == cls
+ && i.sub_type == sub_type)
+ return (&i);
+
+ item = i.link;
+ }
+ }
+ return (NULL);
+}
+
static bool find_subtype_by_name(item_def &item,
object_class_type base_type, int ntypes,
const std::string &name)