diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-06-27 22:40:38 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-06-27 22:40:38 +0000 |
commit | 0b56ccc1b85abf5677a275f888203fb1e336b9dd (patch) | |
tree | e0aa8594049e4bb0a3aab7e0d9a9ef9f816cd2a2 /crawl-ref/source | |
parent | 1be101fd1fc43a252cdc4debf475edf0c6dba81b (diff) | |
download | crawl-ref-0b56ccc1b85abf5677a275f888203fb1e336b9dd.tar.gz crawl-ref-0b56ccc1b85abf5677a275f888203fb1e336b9dd.zip |
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
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/art-data.txt | 3 | ||||
-rw-r--r-- | crawl-ref/source/shopping.cc | 7 |
2 files changed, 6 insertions, 4 deletions
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: |