summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--crawl-ref/source/beam.cc2
-rw-r--r--crawl-ref/source/ouch.cc13
-rw-r--r--crawl-ref/source/player.cc2
3 files changed, 6 insertions, 11 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 4b5a3c0071..dcc697eba0 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -2240,7 +2240,7 @@ int mons_adjust_flavoured(monsters *monster, bolt &pbolt, int hurted,
break;
case BEAM_MIASMA:
- if (mons_res_negative_energy( monster ) == 3)
+ if (mons_res_negative_energy(monster) == 3)
{
if (doFlavouredEffects)
simple_monster_message(monster, " appears unharmed.");
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)
{
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 8b974881a3..75f39facdf 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -1767,7 +1767,7 @@ int player_prot_life(bool calc_unid, bool temp)
switch (you.attribute[ATTR_TRANSFORMATION])
{
case TRAN_STATUE:
- pl += 1;
+ pl++;
break;
case TRAN_SERPENT_OF_HELL:
pl += 2;