summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/religion.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-07 20:46:02 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-07 20:46:02 +0000
commita61eb00e7fc73fa51d23c84e2225816a9a9eebac (patch)
treef3f1c99c6afd93b738a9c874e09850aa8970d25b /crawl-ref/source/religion.cc
parentc0be5104be442e01833aa2d407233be2dbeb1235 (diff)
downloadcrawl-ref-a61eb00e7fc73fa51d23c84e2225816a9a9eebac.tar.gz
crawl-ref-a61eb00e7fc73fa51d23c84e2225816a9a9eebac.zip
Add more prayer-related fixes.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7179 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/religion.cc')
-rw-r--r--crawl-ref/source/religion.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 6470269185..f1635c956d 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -2008,9 +2008,12 @@ std::string god_prayer_reaction()
return result;
}
-static bool _god_accepts_prayer(god_type type)
+static bool _god_accepts_prayer(god_type god)
{
- switch(type)
+ if (god_protects_from_harm(god, false) == HPT_PRAYING)
+ return (true);
+
+ switch (god)
{
case GOD_ZIN:
return (zin_sustenance(false));
@@ -5840,25 +5843,25 @@ harm_protection_type god_protects_from_harm(god_type god, bool actual)
{
case GOD_BEOGH:
if (!penance && (!actual || anytime))
- return HPT_ANYTIME;
+ return (HPT_ANYTIME);
break;
case GOD_ZIN:
case GOD_SHINING_ONE:
if (!actual || anytime)
- return HPT_ANYTIME;
+ return (HPT_ANYTIME);
break;
case GOD_ELYVILON:
if (!actual || praying || anytime)
{
- return (you.piety >= min_piety) ? HPT_PRAYING_PLUS_ANYTIME :
- HPT_ANYTIME;
+ return (you.piety >= min_piety) ? HPT_PRAYING_PLUS_ANYTIME
+ : HPT_ANYTIME;
}
break;
default:
break;
}
- return HPT_NONE;
+ return (HPT_NONE);
}
void god_smites_you(god_type god, const char *message,