summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mapmark.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-25 15:33:36 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-25 15:33:36 +0000
commit0afe4c455bf5a0358cf7f6688b413389a5080fcc (patch)
tree9580836186a5f1612b2a98279255ee7af45c1063 /crawl-ref/source/mapmark.cc
parentad382c58bd22273fdcb13759bf35e1c89d573e97 (diff)
downloadcrawl-ref-0afe4c455bf5a0358cf7f6688b413389a5080fcc.tar.gz
crawl-ref-0afe4c455bf5a0358cf7f6688b413389a5080fcc.zip
Ziggurat portals charge gold for entry.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7610 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mapmark.cc')
-rw-r--r--crawl-ref/source/mapmark.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/crawl-ref/source/mapmark.cc b/crawl-ref/source/mapmark.cc
index 269b973cbf..6e4e2f0907 100644
--- a/crawl-ref/source/mapmark.cc
+++ b/crawl-ref/source/mapmark.cc
@@ -337,16 +337,27 @@ void map_lua_marker::activate(bool verbose)
callfn("activate", true, 4);
}
-void map_lua_marker::notify_dgn_event(const dgn_event &e)
+bool map_lua_marker::notify_dgn_event(const dgn_event &e)
{
lua_stack_cleaner clean(dlua);
push_fn_args("event");
clua_push_dgn_event(dlua, &e);
- if (!dlua.callfn("dlua_marker_method", 4, 0))
+ if (!dlua.callfn("dlua_marker_method", 4, 1))
{
mprf(MSGCH_ERROR, "notify_dgn_event: Lua error: %s",
dlua.error.c_str());
+
+ // Lua error prevents veto if the event is vetoable.
+ return (true);
}
+
+ bool accepted = true;
+
+ // We accept only a real boolean false as a veto.
+ if (lua_isboolean(dlua, -1))
+ accepted = lua_toboolean(dlua, -1);
+
+ return (accepted);
}
std::string map_lua_marker::call_str_fn(const char *fn) const