summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/misc.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-25 16:03:36 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-25 16:03:36 +0000
commit74ecb4ad57ac84d6e8471a6d6aa2ac1030ef0dcb (patch)
treebd739b6c2afd48a93568cf5f563c6bd0a049384e /crawl-ref/source/misc.cc
parent0afe4c455bf5a0358cf7f6688b413389a5080fcc (diff)
downloadcrawl-ref-74ecb4ad57ac84d6e8471a6d6aa2ac1030ef0dcb.tar.gz
crawl-ref-74ecb4ad57ac84d6e8471a6d6aa2ac1030ef0dcb.zip
Ditch baroque dgnevent veto mechanism in favour of marker-property-based veto, which is trivial to extend. Also fix turn loss when trying to use a toll portal without enough gold.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7611 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r--crawl-ref/source/misc.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index e70d5fa9e3..86e91cc8bb 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -1613,6 +1613,11 @@ static void _player_change_level_upstairs(dungeon_feature_type stair_find,
}
}
+static bool _marker_vetoes_level_change()
+{
+ return (marker_vetoes_operation("veto_level_change"));
+}
+
void up_stairs(dungeon_feature_type force_stair,
entry_cause_type entry_cause)
{
@@ -1677,8 +1682,7 @@ void up_stairs(dungeon_feature_type force_stair,
}
// Bail if any markers veto the move.
- if (!dungeon_events.fire_vetoable_position_event(DETV_LEAVE_LEVEL,
- you.pos()))
+ if (_marker_vetoes_level_change())
return;
// Checks are done, the character is committed to moving between levels.
@@ -2062,8 +2066,7 @@ void down_stairs( int old_level, dungeon_feature_type force_stair,
}
// Bail if any markers veto the move.
- if (!dungeon_events.fire_vetoable_position_event(DETV_LEAVE_LEVEL,
- you.pos()))
+ if (_marker_vetoes_level_change())
return;
const level_id destination_override(_stair_destination_override());