summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/effects.cc8
-rw-r--r--crawl-ref/source/items.cc17
-rw-r--r--crawl-ref/source/items.h2
-rw-r--r--crawl-ref/source/player.cc2
-rw-r--r--crawl-ref/source/randart.cc2
-rw-r--r--crawl-ref/source/tags.cc2
6 files changed, 25 insertions, 8 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 5b8761cd37..7fd88fac32 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -1355,9 +1355,13 @@ bool acquirement(object_class_type class_wanted, int agent)
if ((doodad.base_type == OBJ_WEAPONS
&& !can_wield(&doodad, false, true))
|| (doodad.base_type == OBJ_ARMOUR
- && !can_wear_armour(doodad, false, true)))
+ && !can_wear_armour(doodad, false, true))
+
+ // Trog does not gift the Wrath of Trog.
+ || (agent == GOD_TROG && is_fixed_artefact(doodad)
+ && doodad.special == SPWPN_WRATH_OF_TROG))
{
- destroy_item(thing_created);
+ destroy_item(thing_created, true);
thing_created = NON_ITEM;
continue;
}
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();
}
diff --git a/crawl-ref/source/items.h b/crawl-ref/source/items.h
index 15bfc072ab..64b3d59131 100644
--- a/crawl-ref/source/items.h
+++ b/crawl-ref/source/items.h
@@ -75,7 +75,7 @@ int get_item_slot( int reserve = 50 );
* religion - spells2 - spells3 - spells4
* *********************************************************************** */
void unlink_item(int dest);
-void destroy_item(int dest);
+void destroy_item(int dest, bool never_created = false);
void destroy_item_stack( int x, int y, int cause = -1 );
void lose_item_stack( int x, int y );
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index d137d8f1b6..7e1a4cdb55 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -5326,7 +5326,7 @@ void player::init()
unique_items.init(UNIQ_NOT_EXISTS);
for (int i = 0; i < NO_UNRANDARTS; i++)
- set_unrandart_exist(i, 0);
+ set_unrandart_exist(i, false);
skills.init(0);
skill_points.init(0);
diff --git a/crawl-ref/source/randart.cc b/crawl-ref/source/randart.cc
index 1a81244651..a0247791ad 100644
--- a/crawl-ref/source/randart.cc
+++ b/crawl-ref/source/randart.cc
@@ -2066,7 +2066,7 @@ bool make_item_unrandart( item_def &item, int unrand_index )
if (unranddata[ unrand_index ].prpty[ RAP_CURSED ])
do_curse_item( item );
- set_unrandart_exist( unrand_index, 1 );
+ set_unrandart_exist( unrand_index, true );
return (true);
} // end make_item_unrandart()
diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc
index 818da4051c..8640b2e758 100644
--- a/crawl-ref/source/tags.cc
+++ b/crawl-ref/source/tags.cc
@@ -1348,7 +1348,7 @@ static void tag_read_you_items(struct tagHeader &th, char minorVersion)
// # of unrandarts could certainly change. If it does,
// the new ones won't exist yet - zero them out.
for (; j < NO_UNRANDARTS; j++)
- set_unrandart_exist(j, 0);
+ set_unrandart_exist(j, false);
}
static PlaceInfo unmarshallPlaceInfo(struct tagHeader &th)