From cc35b4346c4a69d67d16e7a0518fe8abe3de0bc1 Mon Sep 17 00:00:00 2001 From: dolorous Date: Wed, 16 Jul 2008 03:47:42 +0000 Subject: Add more miscellaneous minor fixes. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6574 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/beam.cc | 2 +- crawl-ref/source/ouch.cc | 13 ++++--------- crawl-ref/source/player.cc | 2 +- 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; -- cgit v1.2.3-54-g00ecf