summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tags.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/tags.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/tags.cc')
-rw-r--r--crawl-ref/source/tags.cc23
1 files changed, 8 insertions, 15 deletions
diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc
index 6cebd63dc1..d966ec3efc 100644
--- a/crawl-ref/source/tags.cc
+++ b/crawl-ref/source/tags.cc
@@ -867,22 +867,15 @@ static void tag_construct_you_items(struct tagHeader &th)
}
// identification status
+ const id_arr& identy(get_typeid_array());
// how many types?
- marshallByte(th, 4);
+ marshallByte(th, static_cast<char>(identy.width()));
// how many subtypes?
- marshallByte(th, 50);
-
- // this is really dumb. We copy the id[] array from itemname
- // to the stack, for no good reason that I can see.
- id_arr identy;
-
- save_id(identy, true);
+ marshallByte(th, static_cast<char>(identy.height()));
- for (i = 0; i < 4; ++i)
- {
- for (j = 0; j < 50; ++j)
- marshallByte(th, identy[i][j]);
- }
+ for (i = 0; i < identy.width(); ++i)
+ for (j = 0; j < identy.height(); ++j)
+ marshallByte(th, static_cast<char>(identy[i][j]));
// how many unique items?
marshallByte(th, 50);
@@ -1198,8 +1191,8 @@ static void tag_read_you_items(struct tagHeader &th, char minorVersion)
{
for (j = 0; j < count_c2; ++j)
{
- char ch;
- ch = unmarshallByte(th);
+ const item_type_id_state_type ch =
+ static_cast<item_type_id_state_type>(unmarshallByte(th));
switch (i)
{