diff options
author | Chris Oelmueller <chris.oelmueller@gmail.com> | 2014-04-10 00:51:14 +0200 |
---|---|---|
committer | Nicholas Feinberg <pleasingfung@gmail.com> | 2014-06-13 23:41:47 -0700 |
commit | fb1f07938f338f48beaa5f386ca8431d4474e460 (patch) | |
tree | f78cf96874bbafdf75f2a9bb18741750fe312548 /crawl-ref/source/shopping.cc | |
parent | 3832802e78ab0fb923eb014c907b8b8fbc1f9715 (diff) | |
download | crawl-ref-fb1f07938f338f48beaa5f386ca8431d4474e460.tar.gz crawl-ref-fb1f07938f338f48beaa5f386ca8431d4474e460.zip |
Simplify some code now that slaying only uses item.plus
Diffstat (limited to 'crawl-ref/source/shopping.cc')
-rw-r--r-- | crawl-ref/source/shopping.cc | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc index a7d4205322..730f635483 100644 --- a/crawl-ref/source/shopping.cc +++ b/crawl-ref/source/shopping.cc @@ -2234,14 +2234,8 @@ unsigned int ShoppingList::cull_identical_items(const item_def& item, // Ignore stat-modification rings which reduce a stat, since they're // worthless. - if (item.base_type == OBJ_JEWELLERY) - { - if (item.sub_type == RING_SLAYING && item.plus < 0 && item.plus2 < 0) - return 0; - - if (item.plus < 0) - return 0; - } + if (item.base_type == OBJ_JEWELLERY && item.plus < 0) + return 0; // Manuals are consumable, and interesting enough to keep on list. if (item.base_type == OBJ_BOOKS && item.sub_type == BOOK_MANUAL) @@ -2283,14 +2277,12 @@ unsigned int ShoppingList::cull_identical_items(const item_def& item, // known pluses when the new ring's pluses are unknown. if (item.base_type == OBJ_JEWELLERY) { - const int nplus = ring_has_pluses(item); + const bool has_plus = ring_has_pluses(item); const int delta_p = item.plus - list_item.plus; - const int delta_p2 = nplus >= 2 ? item.plus2 - list_item.plus2 : 0; - if (nplus + if (has_plus && item_ident(list_item, ISFLAG_KNOW_PLUSES) && (!item_ident(item, ISFLAG_KNOW_PLUSES) - || delta_p <= 0 && delta_p2 <= 0 - && (delta_p < 0 || delta_p2 < 0))) + || delta_p < 0)) { continue; } |