summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/chardump.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-04-24 22:38:41 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-04-24 22:38:41 +0000
commit9304ae6cc3684377e50e6fcbc3d13e80fa092b6a (patch)
treeb0b15e708dbca7e6455bf0e6e3726b75037f937b /crawl-ref/source/chardump.cc
parent56b6c4f46ec7516396c1473e9d5bfef7ea79765f (diff)
downloadcrawl-ref-9304ae6cc3684377e50e6fcbc3d13e80fa092b6a.tar.gz
crawl-ref-9304ae6cc3684377e50e6fcbc3d13e80fa092b6a.zip
Cleaned up shop-handling code considerably.
Instead of shops passing around global id_arr arrays, shops use the newly added third argument to item_def::name() which indicates whether to override item ID status. This means that the shop ID SIGHUP protection is now unnecessary; it's been removed. Hopefully I caught all the places where the stash tracker tries to get item names and fixed them, but I might have missed something. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1359 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/chardump.cc')
-rw-r--r--crawl-ref/source/chardump.cc15
1 files changed, 2 insertions, 13 deletions
diff --git a/crawl-ref/source/chardump.cc b/crawl-ref/source/chardump.cc
index 85d3bb1359..f7fef93fa2 100644
--- a/crawl-ref/source/chardump.cc
+++ b/crawl-ref/source/chardump.cc
@@ -563,7 +563,6 @@ static void sdump_religion(const std::string &, std::string & text)
}
}
-extern char id[4][50]; // itemname.cc
static bool dump_item_origin(const item_def &item, int value)
{
#define fs(x) (flags & (x))
@@ -611,7 +610,7 @@ static bool dump_item_origin(const item_def &item, int value)
if (refpr == -1)
return (false);
if (value == -1)
- value = item_value( item, id, false );
+ value = item_value( item, false );
return (value >= refpr);
#undef fs
}
@@ -624,18 +623,9 @@ static bool dump_item_origin(const item_def &item, int value)
static void sdump_inventory(const std::string &, std::string & text)
{
int i, j;
- char temp_id[4][50];
std::string text2;
- for (i = 0; i < 4; i++)
- {
- for (j = 0; j < 50; j++)
- {
- temp_id[i][j] = 1;
- }
- }
-
int inv_class2[OBJ_GOLD];
int inv_count = 0;
char tmp_quant[20];
@@ -704,8 +694,7 @@ static void sdump_inventory(const std::string &, std::string & text)
{
text += " (";
- itoa( ival =
- item_value( you.inv[j], temp_id, true ),
+ itoa( ival = item_value( you.inv[j], true ),
tmp_quant, 10 );
text += tmp_quant;