diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-09 11:39:22 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-09 11:39:22 +0000 |
commit | 1202f9248def0a7f685700191d29e97c601c7500 (patch) | |
tree | c2833c8d4c574595bf178814fcf243a1a74ecd4e /crawl-ref/source/items.cc | |
parent | 40101238e74b934e879e94e6ae5ec4a6ae86f337 (diff) | |
download | crawl-ref-1202f9248def0a7f685700191d29e97c601c7500.tar.gz crawl-ref-1202f9248def0a7f685700191d29e97c601c7500.zip |
Added an actual vector version of CrawlHashTable, and removed the code
for making a hash table imitate a vector. Since there's now more than
just one type of savable/restorable container, hash.cc and hash.h have
been renamed to store.cc and store.h ("store" for storage).
Destroying/unlinking/deleting an item now clears out the item's props
field.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2389 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/items.cc')
-rw-r--r-- | crawl-ref/source/items.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index 35e84a18d9..c50d7e5efc 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -264,6 +264,7 @@ bool dec_inv_item_quantity( int obj, int amount ) you.inv[obj].base_type = OBJ_UNASSIGNED; you.inv[obj].quantity = 0; + you.inv[obj].props.clear(); ret = true; @@ -462,6 +463,7 @@ void unlink_item( int dest ) mitm[dest].x = 0; mitm[dest].y = 0; mitm[dest].link = NON_ITEM; + mitm[dest].props.clear(); // Look through all items for links to this item. for (c = 0; c < MAX_ITEMS; c++) @@ -579,6 +581,7 @@ void lose_item_stack( int x, int y ) mitm[o].base_type = OBJ_UNASSIGNED; mitm[o].quantity = 0; + mitm[o].props.clear(); } o = next; @@ -601,6 +604,7 @@ void destroy_item_stack( int x, int y, int cause ) mitm[o].base_type = OBJ_UNASSIGNED; mitm[o].quantity = 0; + mitm[o].props.clear(); } o = next; |