summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/shopping.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-07 16:04:17 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-07 16:04:17 +0000
commit9575aca8560b78a5c4dbb50698ab7902863708d3 (patch)
tree042915f3166e0e75e6973a840f370991bb98ba76 /crawl-ref/source/shopping.cc
parent247c86d819723d311cdf53eed4bbbe63b272eadc (diff)
downloadcrawl-ref-9575aca8560b78a5c4dbb50698ab7902863708d3.tar.gz
crawl-ref-9575aca8560b78a5c4dbb50698ab7902863708d3.zip
Add tiles for disturbance in shallow water (only preliminary since you
can only recognize them if you're looking for them), and for closed shops. Move statue tiles into monster folder. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7767 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/shopping.cc')
-rw-r--r--crawl-ref/source/shopping.cc17
1 files changed, 13 insertions, 4 deletions
diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc
index 7233e11905..455abd005a 100644
--- a/crawl-ref/source/shopping.cc
+++ b/crawl-ref/source/shopping.cc
@@ -1667,6 +1667,15 @@ unsigned int item_value( item_def item, bool ident )
return (valued);
} // end item_value()
+// Returns true if a shop is out of stock.
+bool shop_is_closed(const coord_def &where)
+{
+ for (int i = 0; i < MAX_SHOPS; i++)
+ if (env.shop[i].pos == where)
+ return _shop_get_stock(i).empty();
+
+ return (false);
+}
void shop()
{
@@ -1703,12 +1712,12 @@ shop_struct *get_shop(const coord_def& where)
if (grd(where) != DNGN_ENTER_SHOP)
return (NULL);
- // find shop
+ // Find shop.
for (int shoppy = 0; shoppy < MAX_SHOPS; shoppy ++)
{
- // find shop index plus a little bit of paranoia
- if (env.shop[shoppy].pos == where &&
- env.shop[shoppy].type != SHOP_UNASSIGNED)
+ // Find shop index plus a little bit of paranoia.
+ if (env.shop[shoppy].pos == where
+ && env.shop[shoppy].type != SHOP_UNASSIGNED)
{
return (&env.shop[shoppy]);
}