diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-28 16:23:06 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-28 16:23:06 +0000 |
commit | 0371e07ab64fc457f74a6640f06a5b439038ceee (patch) | |
tree | dda15773f5bce673944f1a61f578c22f0c70cdb6 /crawl-ref/source/mapmark.cc | |
parent | fec3e431ad8d5c47c29a20c4dc81820f867fda23 (diff) | |
download | crawl-ref-0371e07ab64fc457f74a6640f06a5b439038ceee.tar.gz crawl-ref-0371e07ab64fc457f74a6640f06a5b439038ceee.zip |
On a crash, do consistency checking on the level's markers, dump the level's
markers, and dump the persistant Lua data.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8839 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mapmark.cc')
-rw-r--r-- | crawl-ref/source/mapmark.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/crawl-ref/source/mapmark.cc b/crawl-ref/source/mapmark.cc index 38fd93a997..b6137c3d2e 100644 --- a/crawl-ref/source/mapmark.cc +++ b/crawl-ref/source/mapmark.cc @@ -407,6 +407,25 @@ std::string map_lua_marker::property(const std::string &pname) const return (result); } +std::string map_lua_marker::debug_to_string() const +{ + lua_stack_cleaner cln(dlua); + + if (!get_table()) + return ("Unable to get table for lua marker."); + + if (!dlua.callfn("table_to_string", 1, 1)) + return make_stringf("error (table_to_string): %s", + dlua.error.c_str()); + + std::string result; + if (lua_isstring(dlua, -1)) + result = lua_tostring(dlua, -1); + else + result = "table_to_string() returned nothing"; + return (result); +} + map_marker *map_lua_marker::parse( const std::string &s, const std::string &ctx) throw (std::string) { |