summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorDarshan Shaligram <dshaligram@users.sourceforge.net>2010-01-05 21:36:46 +0530
committerDarshan Shaligram <dshaligram@users.sourceforge.net>2010-01-05 21:36:46 +0530
commit666caed8492c832aeb4619140cac60c28e777088 (patch)
treed2a07d1dca4b93936ca9ef8b3f20493a2a143bdc /crawl-ref/source
parent75767212fc2d94f27b9d848f58ca0a7b9bf4c26e (diff)
downloadcrawl-ref-666caed8492c832aeb4619140cac60c28e777088.tar.gz
crawl-ref-666caed8492c832aeb4619140cac60c28e777088.zip
Make seen weapon/armour load conditional on v>=15.1 (rob).
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/tags.cc25
-rw-r--r--crawl-ref/source/tags.h1
2 files changed, 15 insertions, 11 deletions
diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc
index 816edcf061..5c5190bccd 100644
--- a/crawl-ref/source/tags.cc
+++ b/crawl-ref/source/tags.cc
@@ -1655,17 +1655,20 @@ static void tag_read_you_items(reader &th, char minorVersion)
for (j = 0; j < count_s; ++j)
you.seen_spell[j] = unmarshallByte(th);
- count_s = unmarshallShort(th);
- if (count_s > NUM_WEAPONS)
- count_s = NUM_WEAPONS;
- for (j = 0; j < count_s; ++j)
- you.seen_weapon[j] = unmarshallLong(th);
-
- count_s = unmarshallShort(th);
- if (count_s > NUM_ARMOURS)
- count_s = NUM_ARMOURS;
- for (j = 0; j < count_s; ++j)
- you.seen_armour[j] = unmarshallLong(th);
+ if (minorVersion >= TAG_MINOR_SEEN_WEAPONS_ARMOUR)
+ {
+ count_s = unmarshallShort(th);
+ if (count_s > NUM_WEAPONS)
+ count_s = NUM_WEAPONS;
+ for (j = 0; j < count_s; ++j)
+ you.seen_weapon[j] = unmarshallLong(th);
+
+ count_s = unmarshallShort(th);
+ if (count_s > NUM_ARMOURS)
+ count_s = NUM_ARMOURS;
+ for (j = 0; j < count_s; ++j)
+ you.seen_armour[j] = unmarshallLong(th);
+ }
}
static PlaceInfo unmarshallPlaceInfo(reader &th)
diff --git a/crawl-ref/source/tags.h b/crawl-ref/source/tags.h
index d0a28c2b6c..7cf59c42c9 100644
--- a/crawl-ref/source/tags.h
+++ b/crawl-ref/source/tags.h
@@ -47,6 +47,7 @@ enum tag_major_version
enum tag_minor_version
{
TAG_MINOR_RESET = 0, // Minor tags were reset
+ TAG_MINOR_SEEN_WEAPONS_ARMOUR = 1,
TAG_MINOR_BEHELD16 = 2, // Use correct type sizes for beholders
TAG_MINOR_VERSION = 2 // Current version. (Keep equal to max.)
};