summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/misc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r--crawl-ref/source/misc.cc28
1 files changed, 24 insertions, 4 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index b14ae92f3a..64fe325825 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -1700,6 +1700,25 @@ static bool _stair_moves_pre(dungeon_feature_type stair)
return (true);
}
+static bool _check_carrying_orb()
+{
+ // We never picked up the Orb, all's okay.
+ if (you.char_direction != GDT_ASCENDING)
+ return (true);
+
+ // So we did pick up the Orb. Now check whether we're carrying it.
+ for (int i = 0; i < ENDOFPACK; i++)
+ {
+ if (is_valid_item( you.inv[i] )
+ && you.inv[i].base_type == OBJ_ORBS
+ && you.inv[i].sub_type == ORB_ZOT)
+ {
+ return (true);
+ }
+ }
+ return (yes_or_no("You're not carrying the Orb! Leave anyway"));
+}
+
void up_stairs(dungeon_feature_type force_stair,
entry_cause_type entry_cause)
{
@@ -1761,7 +1780,8 @@ void up_stairs(dungeon_feature_type force_stair,
&& !destination_override.is_valid();
if (leaving_dungeon
- && !yesno("Are you sure you want to leave the Dungeon?", false, 'n'))
+ && (!yesno("Are you sure you want to leave the Dungeon?", false, 'n')
+ || !_check_carrying_orb()))
{
mpr("Alright, then stay!");
return;
@@ -1860,9 +1880,9 @@ void up_stairs(dungeon_feature_type force_stair,
viewwindow(true, true);
- // Left Zot without enough runes to get back in (probably because
- // of dropping some runes within Zot), but need to get back in Zot
- // to get the Orb? Xom finds that funny.
+ // Left Zot without enough runes to get back in (because they were
+ // destroyed), but need to get back in Zot to get the Orb?
+ // Xom finds that funny.
if (stair_find == DNGN_RETURN_FROM_ZOT
&& branches[BRANCH_HALL_OF_ZOT].branch_flags & BFLAG_HAS_ORB)
{