summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-09-03 15:22:19 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-09-03 15:22:19 +0000
commitaf623e95fcce1864ff8c52010aac55847ba28ba8 (patch)
treede6f2098f4f40a2b9920993cbb4959e5490b0272
parentdf343eb48f7d3a85d7cc1275d4e804019bbdf21b (diff)
downloadcrawl-ref-af623e95fcce1864ff8c52010aac55847ba28ba8.tar.gz
crawl-ref-af623e95fcce1864ff8c52010aac55847ba28ba8.zip
r82@xenon: dshaligram | 2006-09-03 20:54:08 +051800
Fixed stash-tracker brokenness where dumping a randart could trigger an infinite loop. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup@30 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/stash.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/crawl-ref/source/stash.cc b/crawl-ref/source/stash.cc
index 496a113bd8..dbdfef440d 100644
--- a/crawl-ref/source/stash.cc
+++ b/crawl-ref/source/stash.cc
@@ -468,8 +468,6 @@ void Stash::write(std::ostream &os,
bool identify)
const
{
- int i;
-
if (!enabled || (items.size() == 0 && verified)) return;
os << "(" << ((int) x - refx) << ", " << ((int) y - refy)
<< (place.length()? ", " + place : "")
@@ -477,7 +475,7 @@ void Stash::write(std::ostream &os,
<< std::endl;
char buf[ITEMNAME_SIZE];
- for (i = 0; i < (int) items.size(); ++i)
+ for (int i = 0; i < (int) items.size(); ++i)
{
item_def item = items[i];
@@ -513,9 +511,9 @@ void Stash::write(std::ostream &os,
if (desc.length())
{
// Walk backwards and prepend indenting spaces to \n characters
- for (i = desc.length() - 1; i >= 0; --i)
- if (desc[i] == '\n')
- desc.insert(i + 1, " ");
+ for (int j = desc.length() - 1; j >= 0; --j)
+ if (desc[j] == '\n')
+ desc.insert(j + 1, " ");
os << " " << desc << std::endl;
}
}