summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dbg-asrt.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2013-09-09 01:50:37 +0200
committerAdam Borowski <kilobyte@angband.pl>2013-09-09 01:50:37 +0200
commitaccbb5d310af8b61e249dd4dd22060f59b676d0a (patch)
treefc45f4a40084713d1c56f39fc7cdea83ca94af41 /crawl-ref/source/dbg-asrt.cc
parent7b6d41b5512e656c4abb527e184360a5cadd06c8 (diff)
downloadcrawl-ref-accbb5d310af8b61e249dd4dd22060f59b676d0a.tar.gz
crawl-ref-accbb5d310af8b61e249dd4dd22060f59b676d0a.zip
Don't use enum numbers for mutations in crash dumps.
Also, include temporary ones. Also, don't call all innates "demon".
Diffstat (limited to 'crawl-ref/source/dbg-asrt.cc')
-rw-r--r--crawl-ref/source/dbg-asrt.cc36
1 files changed, 29 insertions, 7 deletions
diff --git a/crawl-ref/source/dbg-asrt.cc b/crawl-ref/source/dbg-asrt.cc
index 4608973171..cb2fb36c46 100644
--- a/crawl-ref/source/dbg-asrt.cc
+++ b/crawl-ref/source/dbg-asrt.cc
@@ -26,6 +26,7 @@
#include "message.h"
#include "monster.h"
#include "mon-util.h"
+#include "mutation.h"
#include "options.h"
#include "religion.h"
#include "skills2.h"
@@ -272,15 +273,36 @@ static void _dump_player(FILE *file)
fprintf(file, "Mutations:\n");
for (int i = 0; i < NUM_MUTATIONS; ++i)
- if (you.mutation[i] > 0)
- fprintf(file, " #%d: %d\n", i, you.mutation[i]);
+ {
+ mutation_type mut = static_cast<mutation_type>(i);
+ int normal = you.mutation[i];
+ int innate = you.innate_mutations[i];
+ int temp = you.temp_mutations[i];
+
+ // Normally innate and temp imply normal, but a crash handler should
+ // expect the spanish^Wunexpected.
+ if (!normal && !innate && !temp)
+ continue;
- fprintf(file, "\n");
+ if (const char* name = mutation_name(mut))
+ fprintf(file, " %s: %d", name, normal);
+ else
+ fprintf(file, " unknown #%d: %d", i, normal);
- fprintf(file, "Demon mutations:\n");
- for (int i = 0; i < NUM_MUTATIONS; ++i)
- if (you.innate_mutations[i] > 0)
- fprintf(file, " #%d: %d\n", i, you.innate_mutations[i]);
+ if (innate)
+ if (innate == normal)
+ fprintf(file, " (innate)");
+ else
+ fprintf(file, " (%d innate)", innate);
+
+ if (temp)
+ if (temp == normal)
+ fprintf(file, " (temporary)");
+ else
+ fprintf(file, " (%d temporary)", temp);
+
+ fprintf(file, "\n");
+ }
fprintf(file, "\n");