From 0b56ccc1b85abf5677a275f888203fb1e336b9dd Mon Sep 17 00:00:00 2001 From: zelgadis Date: Sat, 27 Jun 2009 22:40:38 +0000 Subject: Fixed item_value() valuation of unrandarts with non-standard values. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10062 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/art-data.txt | 3 ++- crawl-ref/source/shopping.cc | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/art-data.txt b/crawl-ref/source/art-data.txt index feab12a21e..7583b01c6d 100644 --- a/crawl-ref/source/art-data.txt +++ b/crawl-ref/source/art-data.txt @@ -149,7 +149,8 @@ # See Tiles section above. # TILE_EQ: The file containing the equipment tile for the player doll as # defined in rltiles/dc-player.txt. See Tiles section above. -# VALUE: Modifies the value returned by item_value() +# VALUE: item_value() will return this number instead of doing automatic +# calculations to determine the value. ################################################################## diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc index 30d0907f3f..24ca43d0e9 100644 --- a/crawl-ref/source/shopping.cc +++ b/crawl-ref/source/shopping.cc @@ -616,15 +616,16 @@ unsigned int item_value( item_def item, bool ident ) // copy to mangle as necessary. item.flags = (ident) ? (item.flags | ISFLAG_IDENT_MASK) : (item.flags); - int valued = 0; - if (is_unrandom_artefact( item ) && item_ident( item, ISFLAG_KNOW_PROPERTIES )) { const unrandart_entry *entry = get_unrand_entry(item.special); - valued += entry->value; + if (entry->value != 0) + return (entry->value); } + int valued = 0; + switch (item.base_type) { case OBJ_WEAPONS: -- cgit v1.2.3-54-g00ecf