diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-16 05:27:52 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-16 05:27:52 +0000 |
commit | 5bc26d2ec84ef6c3163012109a9ef388862a6852 (patch) | |
tree | 319decb6ddb29e8d4be2c28a7cffb96115d52332 /crawl-ref/source/religion.cc | |
parent | cc35b4346c4a69d67d16e7a0518fe8abe3de0bc1 (diff) | |
download | crawl-ref-5bc26d2ec84ef6c3163012109a9ef388862a6852.tar.gz crawl-ref-5bc26d2ec84ef6c3163012109a9ef388862a6852.zip |
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
Diffstat (limited to 'crawl-ref/source/religion.cc')
-rw-r--r-- | crawl-ref/source/religion.cc | 9 |
1 files changed, 7 insertions, 2 deletions
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. |