summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/stash.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-06 00:05:32 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-06 00:05:32 +0000
commit9eb2c4a0906be48b60a5bb297abf507e6112c7bc (patch)
treefb6fd0bdbee2aa1721b2195b7a4009a10e2020b1 /crawl-ref/source/stash.cc
parentde3ab3ce26d65fe03341feda94103982a01d8922 (diff)
downloadcrawl-ref-9eb2c4a0906be48b60a5bb297abf507e6112c7bc.tar.gz
crawl-ref-9eb2c4a0906be48b60a5bb297abf507e6112c7bc.zip
In the interest of efficency only call StashTrack.update_corpses()
when absolutelty necessary, rather than whenever the player isn't delayed. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5493 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/stash.cc')
-rw-r--r--crawl-ref/source/stash.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/crawl-ref/source/stash.cc b/crawl-ref/source/stash.cc
index 694a2996a4..7bfcd18ba8 100644
--- a/crawl-ref/source/stash.cc
+++ b/crawl-ref/source/stash.cc
@@ -615,6 +615,9 @@ void Stash::_update_corpses(long rot_time)
void Stash::add_item(const item_def &item, bool add_to_front)
{
+ if (_is_rottable(item))
+ StashTrack.update_corpses();
+
if (add_to_front)
items.insert(items.begin(), item);
else
@@ -1569,6 +1572,8 @@ void StashTracker::search_stashes()
{
char buf[400];
+ this->update_corpses();
+
stash_search_reader reader(buf, sizeof buf);
bool validline = false;