summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dbg-asrt.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2013-10-03 16:46:11 +0200
committerAdam Borowski <kilobyte@angband.pl>2013-10-03 16:53:28 +0200
commit4eb1f020972155a08c030a519b22d84673de375e (patch)
tree3a6b209f4be4e3b41c9e7d772eb614ad970382fa /crawl-ref/source/dbg-asrt.cc
parent52fd99ff6e02a6dda0120e65b90e483e9bb0d90a (diff)
downloadcrawl-ref-4eb1f020972155a08c030a519b22d84673de375e.tar.gz
crawl-ref-4eb1f020972155a08c030a519b22d84673de375e.zip
If a crash happens during map generation, dump the whole grd.
Rather than just some useless screenshot, usually from (0, 0).
Diffstat (limited to 'crawl-ref/source/dbg-asrt.cc')
-rw-r--r--crawl-ref/source/dbg-asrt.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/crawl-ref/source/dbg-asrt.cc b/crawl-ref/source/dbg-asrt.cc
index 2e6b657e4a..16f53f5630 100644
--- a/crawl-ref/source/dbg-asrt.cc
+++ b/crawl-ref/source/dbg-asrt.cc
@@ -9,6 +9,7 @@
#include <signal.h>
#include "abyss.h"
+#include "chardump.h"
#include "clua.h"
#include "coord.h"
#include "coordit.h"
@@ -17,6 +18,7 @@
#include "dbg-util.h"
#include "directn.h"
#include "dlua.h"
+#include "dungeon.h"
#include "env.h"
#include "initfile.h"
#include "itemname.h"
@@ -727,8 +729,16 @@ void do_crash_dump()
#endif
// Now a screenshot
- fprintf(file, "\nScreenshot:\n");
- fprintf(file, "%s\n", screenshot().c_str());
+ if (Generating_Level)
+ {
+ fprintf(file, "\nMap:\n");
+ dump_map(file, true);
+ }
+ else
+ {
+ fprintf(file, "\nScreenshot:\n");
+ fprintf(file, "%s\n", screenshot().c_str());
+ }
// If anything has screwed up the Lua runtime stacks then trying to
// print those stacks will likely crash, so do this after the others.