summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tags.cc
diff options
context:
space:
mode:
authorpauldubois <pauldubois@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-14 07:35:39 +0000
committerpauldubois <pauldubois@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-14 07:35:39 +0000
commit94ceb87517474ac372a41a52a3448104f51435bf (patch)
tree9a39e73ebab7856f7da8ea68aa6e6c1a15ee4713 /crawl-ref/source/tags.cc
parentbfeb59ed40adef39b01dcb1fb9a8e6a500eec1b9 (diff)
downloadcrawl-ref-94ceb87517474ac372a41a52a3448104f51435bf.tar.gz
crawl-ref-94ceb87517474ac372a41a52a3448104f51435bf.zip
Quiver work:
+ bug: if wield sling and no quiver, then pick up stones: should quiver + implement: save and load (does not break saves) + remove: fire_quiver_best + remove: you.quiver + bug: identifying items doesn't update quiver properly + rename: you.quiver_change -> you.redraw_quiver + test no item because of =f git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4227 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tags.cc')
-rw-r--r--crawl-ref/source/tags.cc20
1 files changed, 14 insertions, 6 deletions
diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc
index d0a1dc4396..6c956e1f6c 100644
--- a/crawl-ref/source/tags.cc
+++ b/crawl-ref/source/tags.cc
@@ -79,6 +79,7 @@
#include "monstuff.h"
#include "mon-util.h"
#include "mtransit.h"
+#include "quiver.h"
#include "randart.h"
#include "skills.h"
#include "skills2.h"
@@ -930,10 +931,8 @@ static void tag_construct_you(writer &th)
for (j = 0; j < NUM_ATTRIBUTES; ++j)
marshallByte(th,you.attribute[j]);
- // remembered quiver items
- marshallByte(th, NUM_QUIVER);
- for (j = 0; j < NUM_QUIVER; ++j)
- marshallByte(th,you.quiver[j]);
+ // was: remembered quiver items
+ marshallByte(th, 0);
// sacrifice values
marshallByte(th, NUM_OBJECT_CLASSES);
@@ -1002,6 +1001,9 @@ static void tag_construct_you(writer &th)
// minorVersion 2 starts here
marshallByte(th, you.piety_hysteresis);
+
+ // minorVersion 3 starts here
+ you.m_quiver->save(th);
}
static void tag_construct_you_items(writer &th)
@@ -1322,10 +1324,13 @@ static void tag_read_you(reader &th, char minorVersion)
for (j = 0; j < count_c; ++j)
you.attribute[j] = unmarshallByte(th);
- // how many quiver types?
+ // old: quiver info. Discard it.
count_c = unmarshallByte(th);
+ if (minorVersion >= 3) ASSERT(count_c == 0);
for (j = 0; j < count_c; ++j)
- you.quiver[j] = unmarshallByte(th);
+ {
+ unmarshallByte(th);
+ }
count_c = unmarshallByte(th);
for (j = 0; j < count_c; ++j)
@@ -1381,6 +1386,9 @@ static void tag_read_you(reader &th, char minorVersion)
if (minorVersion >= 2)
you.piety_hysteresis = unmarshallByte(th);
+
+ if (minorVersion >= 3)
+ you.m_quiver->load(th);
}
static void tag_read_you_items(reader &th, char minorVersion)