Travel knows that all branch exits of the same type share the same destination, and will use the nearest branch exit, even if you've never used it before.
The same applies to multiple branch entries, the portals to Zot:1 for instance. This does mean that the first visit to Zot is likely to generate a bad Zot-exit guess (Zot has many entries and many exits), but that'll be fixed the first time the player leaves Zot.
.tc version updated.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@945 c06c8d41-db1a-0410-9941-cceddc491573
NJDPIHOREOTAZJXOMZA5QA4TBADDWLFZ25NVAIFDQ7BUBVUWCEEAC
// If a stair leading out of or into a branch has a known destination, all
// stairs of the same type on this level should have the same destination set
// as guessed_pos == true.
void LevelInfo::sync_all_branch_stairs()
{
std::set<int> synced;
for (int i = 0, size = stairs.size(); i < size; ++i)
{
const stair_info &si = stairs[i];
if (si.destination.id.branch != id.branch && si.destination.is_valid()
&& synced.find(si.grid) == synced.end())
{
synced.insert( si.grid );
sync_branch_stairs( &si );
}
}
}
void LevelInfo::sync_branch_stairs(const stair_info *si)
{
for (int i = 0, size = stairs.size(); i < size; ++i)
{
stair_info &sother = stairs[i];
if (si == &sother || !sother.guessed_pos || si->grid != sother.grid
|| sother.destination.is_valid())
{
continue;
}
sother.destination = si->destination;
}
}