diff options
Diffstat (limited to 'crawl-ref/source/branch.cc')
-rw-r--r-- | crawl-ref/source/branch.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crawl-ref/source/branch.cc b/crawl-ref/source/branch.cc index 298431f866..3f81d87d32 100644 --- a/crawl-ref/source/branch.cc +++ b/crawl-ref/source/branch.cc @@ -12,6 +12,16 @@ Branch& your_branch() return branches[static_cast<int>(you.where_are_you)]; } +branch_type str_to_branch(const std::string &branch, branch_type err) +{ + for (int i = 0; i < NUM_BRANCHES; ++i) + { + if (branches[i].abbrevname && branches[i].abbrevname == branch) + return (static_cast<branch_type>(i)); + } + return (err); +} + Branch branches[] = { { BRANCH_MAIN_DUNGEON, BRANCH_MAIN_DUNGEON, 27, -1, |