summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ouch.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-16 03:47:42 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-16 03:47:42 +0000
commitcc35b4346c4a69d67d16e7a0518fe8abe3de0bc1 (patch)
treebba5a2d0aacb553d9aeca3d3b8393e692ad56e30 /crawl-ref/source/ouch.cc
parent442a5ea7681686ad1a8b65d7043ff69a55f87817 (diff)
downloadcrawl-ref-cc35b4346c4a69d67d16e7a0518fe8abe3de0bc1.tar.gz
crawl-ref-cc35b4346c4a69d67d16e7a0518fe8abe3de0bc1.zip
Add more miscellaneous minor fixes.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6574 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/ouch.cc')
-rw-r--r--crawl-ref/source/ouch.cc13
1 files changed, 4 insertions, 9 deletions
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc
index f53fa8d9bb..e87b2499ab 100644
--- a/crawl-ref/source/ouch.cc
+++ b/crawl-ref/source/ouch.cc
@@ -184,10 +184,7 @@ int check_your_resists(int hurted, beam_type flavour)
// TSO's protection.
if (you.religion == GOD_SHINING_ONE && you.piety > resist * 50)
{
- int unhurted = (you.piety * hurted) / 150;
-
- if (unhurted > hurted)
- unhurted = hurted;
+ int unhurted = std::min(hurted, (you.piety * hurted) / 150);
if (unhurted > 0)
hurted -= unhurted;
@@ -672,7 +669,7 @@ void drain_exp(bool announce_full)
if (protection == 3)
{
- if ( announce_full )
+ if (announce_full)
canned_msg(MSG_YOU_RESIST);
return;
}
@@ -697,10 +694,8 @@ void drain_exp(bool announce_full)
// TSO's protection.
if (you.religion == GOD_SHINING_ONE && you.piety > protection * 50)
{
- unsigned long undrained = (you.piety * exp_drained) / 150;
-
- if (undrained > exp_drained)
- undrained = exp_drained;
+ unsigned long undrained = std::min(exp_drained,
+ (you.piety * exp_drained) / 150);
if (undrained > 0)
{