diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-12 04:04:31 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-12 04:04:31 +0000 |
commit | 3aaa5e00050a0f7a3027ceb9dc6cb8663d4eb968 (patch) | |
tree | 9f64e9f8f6f50bb54ed41106516411a1fea76445 /crawl-ref/source/xom.cc | |
parent | a6b399eae4cd72f6bc2f077a694ecf5ef6b75ffc (diff) | |
download | crawl-ref-3aaa5e00050a0f7a3027ceb9dc6cb8663d4eb968.tar.gz crawl-ref-3aaa5e00050a0f7a3027ceb9dc6cb8663d4eb968.zip |
Simplify.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5749 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/xom.cc')
-rw-r--r-- | crawl-ref/source/xom.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index 18de3e6075..4f353466f3 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -142,8 +142,7 @@ static void _xom_is_stimulated(int maxinterestingness, maxinterestingness, interestingness); #endif - if (interestingness > 255) - interestingness = 255; + interestingness = std::min(255, interestingness); bool was_stimulated = false; if (interestingness > you.gift_timeout && interestingness >= 12) @@ -187,8 +186,7 @@ void xom_makes_you_cast_random_spell(int sever) god_acting gdact(GOD_XOM); const int nxomspells = ARRAYSZ(xom_spells); - if (spellenum > nxomspells) - spellenum = nxomspells; + spellenum = std::min(nxomspells, spellenum); const spell_type spell = xom_spells[random2(spellenum)]; @@ -906,8 +904,7 @@ void xom_acts(bool niceness, int sever) entry_cause_type old_entry_cause = you.entry_cause; - if (sever < 1) - sever = 1; + sever = std::max(1, sever); // Drawing the Xom card from Nemelex's decks of oddities or punishment. if (crawl_state.is_god_acting() |