summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/wiz-mon.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2013-12-03 12:49:40 +0100
committerAdam Borowski <kilobyte@angband.pl>2013-12-03 12:49:40 +0100
commit6378b71d3d036a4591193a4c1b31b76116ec1b2a (patch)
tree1ea7e15f040277665fe27684719d97a466f5ce2a /crawl-ref/source/wiz-mon.cc
parenta248abcac039dda36919e2e8882f83b04685eca1 (diff)
downloadcrawl-ref-6378b71d3d036a4591193a4c1b31b76116ec1b2a.tar.gz
crawl-ref-6378b71d3d036a4591193a4c1b31b76116ec1b2a.zip
Show monster habitats in a ways that allows compile checks.
Diffstat (limited to 'crawl-ref/source/wiz-mon.cc')
-rw-r--r--crawl-ref/source/wiz-mon.cc19
1 files changed, 12 insertions, 7 deletions
diff --git a/crawl-ref/source/wiz-mon.cc b/crawl-ref/source/wiz-mon.cc
index c899704981..7d3f6cc0b1 100644
--- a/crawl-ref/source/wiz-mon.cc
+++ b/crawl-ref/source/wiz-mon.cc
@@ -528,6 +528,16 @@ void wizard_spawn_control()
canned_msg(MSG_OK);
}
+static const char* ht_names[] =
+{
+ "land",
+ "amphibious",
+ "water",
+ "lava",
+ "rock",
+ "incorporeal",
+};
+
// Prints a number of useful (for debugging, that is) stats on monsters.
void debug_stethoscope(int mon)
{
@@ -609,16 +619,11 @@ void debug_stethoscope(int mon)
// Print habitat and behaviour information.
const habitat_type hab = mons_habitat(&mons);
+ COMPILE_CHECK(ARRAYSZ(ht_names) == NUM_HABITATS);
mprf(MSGCH_DIAGNOSTICS,
"hab=%s beh=%s(%d) foe=%s(%d) mem=%d target=(%d,%d) "
"firing_pos=(%d,%d) patrol_point=(%d,%d) god=%s",
- ((hab == HT_LAND) ? "land" :
- (hab == HT_AMPHIBIOUS) ? "amphibious" :
- (hab == HT_WATER) ? "water" :
- (hab == HT_LAVA) ? "lava" :
- (hab == HT_ROCK) ? "rock" :
- (hab == HT_INCORPOREAL) ? "incorporeal"
- : "unknown"),
+ (hab >= 0 && hab < NUM_HABITATS) ? ht_names[hab] : "INVALID",
(mons.asleep() ? "sleep" :
mons_is_wandering(&mons) ? "wander" :
mons_is_seeking(&mons) ? "seek" :