summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/acr.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-17 09:16:56 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-17 09:16:56 +0000
commitc2864252f1c893a9ce7422e9b1fbe43073d6dac9 (patch)
tree78e8159399c849cb039e3aad597c3a4f47331eb7 /crawl-ref/source/acr.cc
parent85b49e81682b73aaaf9c2a6706ed108b87d8611f (diff)
downloadcrawl-ref-c2864252f1c893a9ce7422e9b1fbe43073d6dac9.tar.gz
crawl-ref-c2864252f1c893a9ce7422e9b1fbe43073d6dac9.zip
Adjust Zin's donation routines to only take half your money at once, to
preserve the piety pool when it would cause an overflow, and to increase the maximum value such that donations won't be lost in a normal game. I'm not sure what upper limit to set, especially considering that this is supposed to support DOS and possibly 16-bit values, so, seeing as durations are signed ints, I've set it to 32767, which you can only get all at once with a donation of a little less than 500000 gold. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8501 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/acr.cc')
-rw-r--r--crawl-ref/source/acr.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 46c5be41f6..35d4856076 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -2966,9 +2966,10 @@ static void _decrement_durations()
// (killing monsters, offering items, ...) might be confusing for characters
// of other religions.
// For now, though, keep information about what happened hidden.
- if (you.duration[DUR_PIETY_POOL] > 0 && one_chance_in(5))
+ if (you.piety < MAX_PIETY && you.duration[DUR_PIETY_POOL] > 0
+ && one_chance_in(5))
{
- you.duration[DUR_PIETY_POOL]--; // Decrease even if piety at maximum.
+ you.duration[DUR_PIETY_POOL]--;
gain_piety(1);
#if DEBUG_DIAGNOSTICS || DEBUG_SACRIFICE || DEBUG_PIETY