diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-12-16 11:58:18 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-12-16 11:58:18 +0000 |
commit | 8376e440396796e596cdd49b0d539b5fb48f16f0 (patch) | |
tree | f0298a62dad2a8a69057db7f5f71fd04c6359561 /crawl-ref/source/stash.cc | |
parent | 1ece2e1bb923cba7ce186e93de54fc8dc78b1cd2 (diff) | |
download | crawl-ref-8376e440396796e596cdd49b0d539b5fb48f16f0.tar.gz crawl-ref-8376e440396796e596cdd49b0d539b5fb48f16f0.zip |
Fixed crashes when searching for randarts in stash-tracker.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3078 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/stash.cc')
-rw-r--r-- | crawl-ref/source/stash.cc | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/crawl-ref/source/stash.cc b/crawl-ref/source/stash.cc index 139b9bdb3d..428fef0520 100644 --- a/crawl-ref/source/stash.cc +++ b/crawl-ref/source/stash.cc @@ -135,34 +135,14 @@ static void fully_identify_item(item_def *item) static void save_item(FILE *file, const item_def &item) { - writeByte(file, item.base_type); - writeByte(file, item.sub_type); - writeShort(file, item.plus); - writeShort(file, item.plus2); - writeLong(file, item.special); - writeShort(file, item.quantity); - writeByte(file, item.colour); - writeLong(file, item.flags); - - writeShort(file, item.orig_place); - writeShort(file, item.orig_monnum); - writeString(file, item.inscription.c_str(), 80); + tagHeader th(file); + marshallItem(th, item); } static void load_item(FILE *file, item_def &item) { - item.base_type = static_cast<object_class_type>(readByte(file)); - item.sub_type = readByte(file); - item.plus = readShort(file); - item.plus2 = readShort(file); - item.special = readLong(file); - item.quantity = readShort(file); - item.colour = readByte(file); - item.flags = readLong(file); - - item.orig_place = readShort(file); - item.orig_monnum = readShort(file); - item.inscription = readString(file); + tagHeader th(file); + unmarshallItem(th, item); } bool Stash::aggressive_verify = true; |