summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/stash.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-07 23:44:02 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-07 23:44:02 +0000
commitcdd74d0b4618ad1f8f02ee18036283c6c2214b3d (patch)
tree10aad41074679ccdf7d78a953171482e81bc53a8 /crawl-ref/source/stash.cc
parentf4d7abfdc292ea48cc3fcd1a8c98e0f22abd28f6 (diff)
downloadcrawl-ref-cdd74d0b4618ad1f8f02ee18036283c6c2214b3d.tar.gz
crawl-ref-cdd74d0b4618ad1f8f02ee18036283c6c2214b3d.zip
Actually replace sold out shops with the new feature DNGN_ABANDONED_SHOP.
This makes comparisons much easier and also avoids giving away information about far away shops being opened/closed. (This was only an issue if a shop only held blood potions that rotted away, but still.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7775 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/stash.cc')
-rw-r--r--crawl-ref/source/stash.cc14
1 files changed, 6 insertions, 8 deletions
diff --git a/crawl-ref/source/stash.cc b/crawl-ref/source/stash.cc
index a9b921f1c8..e2840eb12c 100644
--- a/crawl-ref/source/stash.cc
+++ b/crawl-ref/source/stash.cc
@@ -118,13 +118,13 @@ void describe_stash(int x, int y)
if (s)
{
std::string desc = "[Stash: "
- + s->description() + "]";
+ + s->description() + "]";
mpr(desc.c_str(), MSGCH_EXAMINE_FILTER);
}
}
}
-static void fully_identify_item(item_def *item)
+static void _fully_identify_item(item_def *item)
{
if (!item || !is_valid_item(*item))
return;
@@ -254,6 +254,7 @@ bool Stash::is_boring_feature(dungeon_feature_type feat)
case DNGN_ESCAPE_HATCH_DOWN:
case DNGN_ESCAPE_HATCH_UP:
case DNGN_ENTER_SHOP:
+ case DNGN_ABANDONED_SHOP:
case DNGN_UNDISCOVERED_TRAP:
return (true);
default:
@@ -653,7 +654,7 @@ void Stash::write(std::ostream &os, int refx, int refy,
item_def item = items[i];
if (identify)
- fully_identify_item(&item);
+ _fully_identify_item(&item);
std::string s = stash_item_name(item);
strncpy(buf, s.c_str(), sizeof buf);
@@ -961,7 +962,7 @@ void ShopInfo::write(std::ostream &os, bool identify) const
shop_item item = items[i];
if (identify)
- fully_identify_item(&item.item);
+ _fully_identify_item(&item.item);
os << " " << shop_item_name(item) << std::endl;
std::string desc = shop_item_desc(item);
@@ -1186,8 +1187,7 @@ int LevelStashes::_num_enabled_stashes() const
void LevelStashes::get_matching_stashes(
const base_pattern &search,
- std::vector<stash_search_result> &results)
- const
+ std::vector<stash_search_result> &results) const
{
std::string lplace = "{" + m_place.describe() + "}";
for (stashes_t::const_iterator iter = m_stashes.begin();
@@ -1438,7 +1438,6 @@ void StashTracker::update_visible_stashes(
LevelStashes *lev = find_current_level();
for (int cy = crawl_view.glos1.y; cy <= crawl_view.glos2.y; ++cy)
- {
for (int cx = crawl_view.glos1.x; cx <= crawl_view.glos2.x; ++cx)
{
if (!in_bounds(cx, cy) || !see_grid(cx, cy))
@@ -1458,7 +1457,6 @@ void StashTracker::update_visible_stashes(
if (grid == DNGN_ENTER_SHOP)
get_shop(cx, cy);
}
- }
if (lev && !lev->stash_count())
remove_level();