diff options
-rw-r--r-- | crawl-ref/source/items.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/shopping.cc | 5 | ||||
-rw-r--r-- | crawl-ref/source/shopping.h | 1 |
3 files changed, 7 insertions, 1 deletions
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index 6bc86ac2aa..53f4381b7f 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -399,7 +399,7 @@ void unlink_item( int dest ) } else { - ASSERT(in_bounds(mitm[dest].pos)); + ASSERT(in_bounds(mitm[dest].pos) || is_shop_item(mitm[dest])); // Linked item on map: // diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc index 3f0a8f4a17..ecb0a4898d 100644 --- a/crawl-ref/source/shopping.cc +++ b/crawl-ref/source/shopping.cc @@ -1794,3 +1794,8 @@ std::string shop_name(const coord_def& where) return (sh_name); } +bool is_shop_item(const item_def &item) +{ + return (item.pos.x == 0 && item.pos.y >= 5 + && item.pos.y < (MAX_SHOPS + 5)); +} diff --git a/crawl-ref/source/shopping.h b/crawl-ref/source/shopping.h index 8cdb713626..fb9fc2e88c 100644 --- a/crawl-ref/source/shopping.h +++ b/crawl-ref/source/shopping.h @@ -27,4 +27,5 @@ std::string shop_name(const coord_def& where, bool add_stop); bool shoptype_identifies_stock(shop_type type); +bool is_shop_item(const item_def &item); #endif |