From afaae93d272eb3a6b09fde538c8d85005cad91e3 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Mon, 15 Oct 2007 12:27:57 +0000 Subject: [1813214] Trog should not gift the Wrath of Trog. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2472 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/items.cc | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/items.cc') diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index 7fe521fb3f..443ed566eb 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -210,7 +210,7 @@ int cull_items(void) // 9. unmark unrandart int z = find_unrandart_index(item); if (z >= 0) - set_unrandart_exist(z, 0); + set_unrandart_exist(z, false); } // POOF! @@ -506,7 +506,7 @@ void unlink_item( int dest ) #endif } // end unlink_item() -void destroy_item( int dest ) +void destroy_item( int dest, bool never_created ) { // Don't destroy non-items, but this function may be called upon // to remove items reduced to zero quantity, so we allow "invalid" @@ -516,6 +516,19 @@ void destroy_item( int dest ) unlink_item( dest ); + if (never_created) + { + if (is_fixed_artefact(mitm[dest])) + set_unique_item_status( mitm[dest].base_type, mitm[dest].special, + UNIQ_NOT_EXISTS ); + else if (is_unrandom_artefact(mitm[dest])) + { + const int unrand = find_unrandart_index(dest); + if (unrand != -1) + set_unrandart_exist( unrand, false ); + } + } + // paranoia, shouldn't be needed mitm[dest].clear(); } -- cgit v1.2.3-54-g00ecf