summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dbg-maps.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-10-15 19:09:19 +0200
committerAdam Borowski <kilobyte@angband.pl>2012-10-15 20:18:32 +0200
commit4f9bcb7a8d6d963944eded4645a1413e21de9998 (patch)
tree0ca8c72b089a06661753136606079a64d1d30985 /crawl-ref/source/dbg-maps.cc
parent816fcd4f9262b23e42003ecc491da5c447ecbbd2 (diff)
downloadcrawl-ref-4f9bcb7a8d6d963944eded4645a1413e21de9998.tar.gz
crawl-ref-4f9bcb7a8d6d963944eded4645a1413e21de9998.zip
Dump a bad map first, then print a message with MSGCH_ERROR.
Also, close the file afterwards, abort() doesn't flush libc buffers.
Diffstat (limited to 'crawl-ref/source/dbg-maps.cc')
-rw-r--r--crawl-ref/source/dbg-maps.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/crawl-ref/source/dbg-maps.cc b/crawl-ref/source/dbg-maps.cc
index d8066a021c..299cce5bd8 100644
--- a/crawl-ref/source/dbg-maps.cc
+++ b/crawl-ref/source/dbg-maps.cc
@@ -121,10 +121,6 @@ static bool mg_do_build_level(int niters)
if (!vaults.empty())
vaults = " (" + vaults + ")";
- mprf(MSGCH_ERROR,
- "Bad (disconnected) level on %s%s",
- level_id::current().describe().c_str(),
- vaults.c_str());
FILE *fp = fopen("map.dump", "w");
fprintf(fp, "Bad (disconnected) level (%s) on %s%s.\n\n",
env.level_build_method.c_str(),
@@ -132,6 +128,12 @@ static bool mg_do_build_level(int niters)
vaults.c_str());
dump_map(fp);
+ fclose(fp);
+
+ mprf(MSGCH_ERROR,
+ "Bad (disconnected) level on %s%s",
+ level_id::current().describe().c_str(),
+ vaults.c_str());
return false;
}