summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/invent.cc2
-rw-r--r--crawl-ref/source/output.cc12
-rw-r--r--crawl-ref/source/player.cc4
-rw-r--r--crawl-ref/source/religion.cc7
-rw-r--r--crawl-ref/source/spl-cast.cc5
5 files changed, 14 insertions, 16 deletions
diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc
index cfe295166b..0674a06890 100644
--- a/crawl-ref/source/invent.cc
+++ b/crawl-ref/source/invent.cc
@@ -534,7 +534,7 @@ void init_item_sort_comparators(item_sort_comparators &list,
const menu_sort_condition *InvMenu::find_menu_sort_condition() const
{
- for (int i = 0, size = Options.sort_menus.size(); i < size; ++i)
+ for (int i = Options.sort_menus.size() - 1; i >= 0; --i)
if (Options.sort_menus[i].matches(type))
return &Options.sort_menus[i];
diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc
index 32c1bea0f5..68dd12a5e0 100644
--- a/crawl-ref/source/output.cc
+++ b/crawl-ref/source/output.cc
@@ -1566,9 +1566,9 @@ std::vector<formatted_string> get_full_detail(bool calc_unid, long sc)
}
const int rinvi = player_see_invis(calc_unid);
- const int rward = wearing_amulet(AMU_WARDING, calc_unid) ||
- (you.religion == GOD_VEHUMET && you.duration[DUR_PRAYER] &&
- !player_under_penance() && you.piety >= piety_breakpoint(2));
+ const int rward = (wearing_amulet(AMU_WARDING, calc_unid)
+ || you.religion == GOD_VEHUMET && !player_under_penance()
+ && you.piety >= piety_breakpoint(2));
const int rcons = wearing_amulet(AMU_CONSERVATION, calc_unid);
const int rcorr = wearing_amulet(AMU_RESIST_CORROSION, calc_unid);
@@ -1935,9 +1935,9 @@ std::vector<MenuEntry *> _get_overview_screen_results()
const int rinvi = player_see_invis(calc_unid);
- const int rward = wearing_amulet(AMU_WARDING, calc_unid) ||
- (you.religion == GOD_VEHUMET && you.duration[DUR_PRAYER] &&
- !player_under_penance() && you.piety >= piety_breakpoint(2));
+ const int rward = (wearing_amulet(AMU_WARDING, calc_unid)
+ || you.religion == GOD_VEHUMET && !player_under_penance()
+ && you.piety >= piety_breakpoint(2));
const int rcons = wearing_amulet(AMU_CONSERVATION, calc_unid);
const int rcorr = wearing_amulet(AMU_RESIST_CORROSION, calc_unid);
const int rclar = wearing_amulet(AMU_CLARITY, calc_unid);
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 973b73f3f0..108462a7e1 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -6013,8 +6013,8 @@ int player::warding() const
if (wearing_amulet(AMU_WARDING))
return (30);
- if (religion == GOD_VEHUMET && duration[DUR_PRAYER]
- && !player_under_penance() && piety >= piety_breakpoint(2))
+ if (religion == GOD_VEHUMET && !player_under_penance()
+ && piety >= piety_breakpoint(2))
{
// Clamp piety at 160 and scale that down to a max of 30.
const int wardpiety = piety > 160? 160 : piety;
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 3ad061bdfb..6534e9b4fc 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -1516,8 +1516,7 @@ static void _do_god_gift(bool prayed_for)
else if (!you.had_book[BOOK_ANNIHILATIONS])
gift = BOOK_ANNIHILATIONS; // conj books
- if (you.skills[SK_CONJURATIONS] <
- you.skills[SK_SUMMONINGS]
+ if (you.skills[SK_CONJURATIONS] < you.skills[SK_SUMMONINGS]
|| gift == NUM_BOOKS)
{
if (!you.had_book[BOOK_CALLINGS])
@@ -4933,8 +4932,8 @@ bool god_hates_butchery(god_type god)
harm_protection_type god_protects_from_harm(god_type god, bool actual)
{
const int min_piety = piety_breakpoint(0);
- bool praying = (you.duration[DUR_PRAYER] &&
- random2(you.piety) >= min_piety);
+ bool praying = (you.duration[DUR_PRAYER]
+ && random2(you.piety) >= min_piety);
bool anytime = (one_chance_in(10) || you.piety > random2(1000));
bool penance = you.penance[god];
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index c797a21d46..f6fa59eecd 100644
--- a/crawl-ref/source/spl-cast.cc
+++ b/crawl-ref/source/spl-cast.cc
@@ -242,8 +242,7 @@ static int _apply_spellcasting_success_boosts(spell_type spell, int chance)
int wiz_factor = 87;
if (you.religion == GOD_VEHUMET
- && you.duration[DUR_PRAYER]
- && (!player_under_penance() && you.piety >= 50)
+ && !player_under_penance() && you.piety >= 50
&& (spell_typematch(spell, SPTYP_CONJURATION)
|| spell_typematch(spell, SPTYP_SUMMONING)))
{
@@ -453,7 +452,7 @@ int spell_fail(spell_type spell)
}
}
- // Apply the effects of Vehumet prayer and items of wizardry.
+ // Apply the effects of Vehumet and items of wizardry.
chance2 = _apply_spellcasting_success_boosts(spell, chance2);
if (chance2 > 100)