summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/describe.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-25 14:49:06 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-25 14:49:06 +0000
commit2b246a2f1016744c425f9cc9009cfd6b780619b3 (patch)
tree290c2d7c5378fbc769889cb2c8c077b98e484723 /crawl-ref/source/describe.cc
parent54d4d07375bd81654b6b4bca860a4ca8ae045e1e (diff)
downloadcrawl-ref-2b246a2f1016744c425f9cc9009cfd6b780619b3.tar.gz
crawl-ref-2b246a2f1016744c425f9cc9009cfd6b780619b3.zip
Type safety and code cleanup.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2569 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/describe.cc')
-rw-r--r--crawl-ref/source/describe.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index d5bc3b0efa..cab0fb3c99 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -3835,13 +3835,16 @@ std::string ghost_description(const monsters &mons, bool concise)
const ghost_demon &ghost = *(mons.ghost);
+ const species_type gspecies =
+ static_cast<species_type>(ghost.values[GVAL_SPECIES]);
+
// We're fudging stats so that unarmed combat gets based off
// of the ghost's species, not the player's stats... exact
// stats aren't required anyways, all that matters is whether
// dex >= str. -- bwr
const int dex = 10;
int str;
- switch (ghost.values[GVAL_SPECIES])
+ switch (gspecies)
{
case SP_MOUNTAIN_DWARF:
case SP_TROLL:
@@ -3870,7 +3873,7 @@ std::string ghost_description(const monsters &mons, bool concise)
gstr << ghost.name << " the "
<< skill_title( ghost.values[GVAL_BEST_SKILL],
ghost.values[GVAL_SKILL_LEVEL],
- ghost.values[GVAL_SPECIES],
+ gspecies,
str, dex, GOD_NO_GOD )
<< ", a"
<< ((ghost.values[GVAL_EXP_LEVEL] < 4) ? " weakling" :
@@ -3883,10 +3886,10 @@ std::string ghost_description(const monsters &mons, bool concise)
: " legendary")
<< " ";
if ( concise )
- gstr << get_species_abbrev(ghost.values[GVAL_SPECIES])
+ gstr << get_species_abbrev(gspecies)
<< get_class_abbrev(ghost.values[GVAL_CLASS]);
else
- gstr << species_name(ghost.values[GVAL_SPECIES],
+ gstr << species_name(gspecies,
ghost.values[GVAL_EXP_LEVEL])
<< " "
<< get_class_name(ghost.values[GVAL_CLASS]);