From 5f0047a46771cbb691ed76feb3a66d8bbbaf674d Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Fri, 14 Sep 2007 10:58:08 +0000 Subject: Another round of patches, namely: 1794580, 1794576 and 1794376 by zelgadis, and 1794388, 1794372, 1794368 by dolorous. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2086 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/travel.cc | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/travel.cc') diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index 67e9d656b4..381aa76727 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -1869,7 +1869,7 @@ static std::vector get_branches(bool (*selector)(const Branch &)) static bool is_valid_branch(const Branch &br) { - return (!!br.shortname); + return (br.shortname != NULL && br.depth != -1); } static int prompt_travel_branch(int prompt_flags) @@ -1970,7 +1970,33 @@ static int prompt_travel_branch(int prompt_flags) for (int i = 0, count = br.size(); i < count; ++i) { if (toupper(keyin) == branches[br[i]].travel_shortcut) + { +#ifdef WIZARD + Branch &target = branches[br[i]]; + std::string msg = ""; + + if (target.startdepth == -1 + && (i == BRANCH_SWAMP || i == BRANCH_SHOALS )) + { + msg += "Branch not generated this game. "; + } + + if (target.entry_stairs == NUM_FEATURES + && br[i] != BRANCH_MAIN_DUNGEON) + { + msg += "Branch has no entry stairs. "; + } + + if (msg != "") + { + msg += "Go there anyways?"; + if(!yesno(msg.c_str())) + return (ID_CANCEL); + } +#endif + return (br[i]); + } } // Possibly a waypoint number? -- cgit v1.2.3-54-g00ecf