summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/notes.cc
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2012-12-31 19:02:15 -0500
committerNeil Moore <neil@s-z.org>2012-12-31 19:02:15 -0500
commit7a2ed4745eb929322b5c4a971f1c86f7834a5ef4 (patch)
treeda8cd23744a4c2174995ac0ff817aca50fe7453d /crawl-ref/source/notes.cc
parent16b5b170620b4359451b5e5030d2d06433914f65 (diff)
downloadcrawl-ref-7a2ed4745eb929322b5c4a971f1c86f7834a5ef4.tar.gz
crawl-ref-7a2ed4745eb929322b5c4a971f1c86f7834a5ef4.zip
Simplify.
Diffstat (limited to 'crawl-ref/source/notes.cc')
-rw-r--r--crawl-ref/source/notes.cc17
1 files changed, 6 insertions, 11 deletions
diff --git a/crawl-ref/source/notes.cc b/crawl-ref/source/notes.cc
index 0c1fb6ba4c..45e4027a93 100644
--- a/crawl-ref/source/notes.cc
+++ b/crawl-ref/source/notes.cc
@@ -72,8 +72,8 @@ static int _dungeon_branch_depth(uint8_t branch)
static bool _is_noteworthy_dlevel(unsigned short place)
{
- const uint8_t branch = (place >> 8) & 0xFF;
- const int lev = (place & 0xFF);
+ branch_type branch = place_branch(place);
+ int lev = place_depth(place);
// The Abyss is noted a different way (since we care mostly about the cause).
if (branch == BRANCH_ABYSS)
@@ -83,15 +83,10 @@ static bool _is_noteworthy_dlevel(unsigned short place)
if (!is_connected_branch(static_cast<branch_type>(branch)))
return true;
- if (lev == _dungeon_branch_depth(branch)
- || branch == BRANCH_MAIN_DUNGEON && (lev % 5) == 0
- || branch == BRANCH_MAIN_DUNGEON && lev == 14
- || branch != BRANCH_MAIN_DUNGEON && lev == 1)
- {
- return true;
- }
-
- return false;
+ return (lev == _dungeon_branch_depth(branch)
+ || branch == BRANCH_MAIN_DUNGEON && (lev % 5) == 0
+ || branch == BRANCH_MAIN_DUNGEON && lev == 14
+ || branch != BRANCH_MAIN_DUNGEON && lev == 1);
}
// Is a note worth taking?