From 5bc26d2ec84ef6c3163012109a9ef388862a6852 Mon Sep 17 00:00:00 2001 From: dolorous Date: Wed, 16 Jul 2008 05:27:52 +0000 Subject: Only display the explanatory messages when sacrificing items if the player tries to sacrifice some items that his god doesn't like. This avoids e.g. getting such messages when praying to Nemelex while trapped in a net. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6575 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/religion.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/religion.cc') diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 8d7ba6d663..d0f9d7dee0 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -5337,6 +5337,7 @@ void offer_items() return; int num_sacced = 0; + int num_disliked = 0; const int old_leading = _leading_sacrifice_group(); @@ -5344,10 +5345,13 @@ void offer_items() { item_def &item(mitm[i]); const int next = item.link; // in case we can't get it later. + const bool disliked = !_god_likes_item(you.religion, item); - if (item_is_stationary(item) || !_god_likes_item(you.religion, item)) + if (item_is_stationary(item) || disliked) { i = next; + if (disliked) + num_disliked++; continue; } @@ -5410,7 +5414,8 @@ void offer_items() _show_pure_deck_chances(); #endif } - else if (num_sacced == 0) // explanatory messages if nothing sacrificed + // Explanatory messages if nothing the god likes is sacrificed. + else if (num_sacced == 0 && num_disliked > 0) { // Zin was handled above, and the other gods don't care about // sacrifices. -- cgit v1.2.3-54-g00ecf