summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/hiscores.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-05-09 14:55:40 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-05-09 14:55:40 +0000
commit523f4a0a5478fe3146086a980afa5a8f8ff3d052 (patch)
tree8edcb3caf9df66bc6beec9558dba60da3b9b5a4f /crawl-ref/source/hiscores.cc
parent7dfc7ccd3de424f1aab582578aabe0cdfa2f9504 (diff)
downloadcrawl-ref-523f4a0a5478fe3146086a980afa5a8f8ff3d052.tar.gz
crawl-ref-523f4a0a5478fe3146086a980afa5a8f8ff3d052.zip
Interlevel travel tweaks:
* ^P at branch prompt selects the parent branch of the branch you're in (or the main dungeon if you're in the main dungeon). * The depth prompt is always shown, even for single-level branches. This may need to be rolled back if it's too annoying. * At the depth prompt, you can use < to go one level above the default (navigating up into the parent branch if necessary) and > to go one level below the default (never navigating into deeper branches). - or p or ^P will change the default to the level closest to the current default in the parent branch. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1437 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/hiscores.cc')
-rw-r--r--crawl-ref/source/hiscores.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/crawl-ref/source/hiscores.cc b/crawl-ref/source/hiscores.cc
index db78f5d592..50e697b100 100644
--- a/crawl-ref/source/hiscores.cc
+++ b/crawl-ref/source/hiscores.cc
@@ -631,12 +631,12 @@ static const char *short_branch_name(int branch)
return ("");
}
-static int str_to_branch(const std::string &branch)
+static branch_type str_to_branch(const std::string &branch)
{
for (int i = 0; i < NUM_BRANCHES; ++i)
{
if (branches[i].abbrevname && branches[i].abbrevname == branch)
- return (i);
+ return (static_cast<branch_type>(i));
}
return (BRANCH_MAIN_DUNGEON);
}
@@ -653,11 +653,11 @@ static const char *level_area_type_name(int level_type)
return ("");
}
-static int str_to_level_area_type(const std::string &s)
+static level_area_type str_to_level_area_type(const std::string &s)
{
for (int i = 0; i < NUM_LEVEL_AREA_TYPES; ++i)
if (s == level_type_names[i])
- return (i);
+ return (static_cast<level_area_type>(i));
return (LEVEL_DUNGEON);
}
@@ -833,9 +833,9 @@ std::string scorefile_entry::short_kill_message() const
// Maps a 0.1.x branch id to a 0.2 branch id. Ugh. Fortunately we need this
// only to read old logfiles/scorefiles.
-int scorefile_entry::kludge_branch(int branch_01) const
+branch_type scorefile_entry::kludge_branch(int branch_01) const
{
- static int branch_map[] = {
+ static branch_type branch_map[] = {
BRANCH_MAIN_DUNGEON, BRANCH_DIS, BRANCH_GEHENNA,
BRANCH_VESTIBULE_OF_HELL, BRANCH_COCYTUS, BRANCH_TARTARUS,
BRANCH_INFERNO, BRANCH_THE_PIT, BRANCH_MAIN_DUNGEON,
@@ -898,7 +898,7 @@ bool scorefile_entry::parse_obsolete_scoreline(const std::string &line)
auxkilldata[0] = 0;
dlvl = hs_nextint(inbuf);
- level_type = hs_nextint(inbuf);
+ level_type = static_cast<level_area_type>(hs_nextint(inbuf));
branch = kludge_branch( hs_nextint(inbuf) );
final_hp = hs_nextint(inbuf);
@@ -1019,8 +1019,8 @@ void scorefile_entry::reset()
death_source_name[0] = 0;
auxkilldata[0] = 0;
dlvl = 0;
- level_type = 0;
- branch = 0;
+ level_type = LEVEL_DUNGEON;
+ branch = BRANCH_MAIN_DUNGEON;
final_hp = -1;
final_max_hp = -1;
final_max_max_hp = -1;