summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;