From 8bf4f93aa163d478558f5ea3897c6158bd9781ea Mon Sep 17 00:00:00 2001 From: zelgadis Date: Wed, 3 Dec 2008 06:08:48 +0000 Subject: Add another optional parameter to items() of makeitem.{cc,h}, the agent parameter. If not -1 then it will be used to set the acquirement agent of the item. This is done in items() so that make_item_randart() can use it if it's called from items(). Before this _god_fits_artefact() in randart.cc was only being called for choosing an appropriate god for random artifact names, and not to check the appropriateness of the randart proeprties chosen for randart god gifts. Changed _god_fits_artefact() so that if a bug leads a god to gifting an item with an inapropriate base_type or sub_type that it will give an assertion or error message instead of causing make_item_randart() to go into an infinite loop. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7726 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/religion.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/religion.cc') diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 96f45320d3..491e0f2639 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -1137,7 +1137,8 @@ static void _give_nemelex_gift() _update_sacrifice_weights(choice); int thing_created = items( 1, OBJ_MISCELLANY, gift_type, - true, 1, MAKE_ITEM_RANDOM_RACE ); + true, 1, MAKE_ITEM_RANDOM_RACE, + 0, 0, GOD_NEMELEX_XOBEH ); if (thing_created != NON_ITEM) { @@ -1174,7 +1175,6 @@ static void _give_nemelex_gift() deck.inscription = "god gift"; move_item_to_grid( &thing_created, you.pos() ); - origin_acquired(deck, you.religion); simple_god_message(" grants you a gift!"); more(); @@ -1972,7 +1972,8 @@ static void _do_god_gift(bool prayed_for) else { int thing_created = items(1, OBJ_BOOKS, gift, true, 1, - MAKE_ITEM_RANDOM_RACE); + MAKE_ITEM_RANDOM_RACE, + 0, 0, you.religion); if (thing_created == NON_ITEM) return; @@ -1982,7 +1983,6 @@ static void _do_god_gift(bool prayed_for) { success = true; mitm[thing_created].inscription = "god gift"; - origin_acquired(mitm[thing_created], you.religion); } } @@ -4199,7 +4199,8 @@ static bool _beogh_retribution() // Create item. int slot = items(0, OBJ_WEAPONS, WPN_CLUB + random2(13), true, you.experience_level, - am_orc ? MAKE_ITEM_NO_RACE : MAKE_ITEM_ORCISH); + am_orc ? MAKE_ITEM_NO_RACE : MAKE_ITEM_ORCISH, + 0, 0, GOD_BEOGH); if (slot == -1) continue; -- cgit v1.2.3-54-g00ecf