summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/species.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-10-23 19:35:20 +0200
committerRobert Vollmert <rvollmert@gmx.net>2009-10-23 20:30:14 +0200
commit8cc7f8f9a7940798f851d0e6b06195858589159d (patch)
tree58036c94b8c0c71ae8300ca8eaa1be0299e6ba92 /crawl-ref/source/species.cc
parent4c378295ed83f92f9b7fcbd71f1d2c1a0ad48744 (diff)
downloadcrawl-ref-8cc7f8f9a7940798f851d0e6b06195858589159d.tar.gz
crawl-ref-8cc7f8f9a7940798f851d0e6b06195858589159d.zip
Renumber species_type starting from 0.
It now behaves like the other enums (e.g. job_type). I hope I got all places where SP_HUMAN == 1 was assumed.
Diffstat (limited to 'crawl-ref/source/species.cc')
-rw-r--r--crawl-ref/source/species.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/crawl-ref/source/species.cc b/crawl-ref/source/species.cc
index f5ceb28751..02cc3f4c38 100644
--- a/crawl-ref/source/species.cc
+++ b/crawl-ref/source/species.cc
@@ -69,7 +69,7 @@ species_type get_species(const int index)
}
static const char * Species_Abbrev_List[NUM_SPECIES] =
- { "XX", "Hu", "HE", "DE", "SE", "MD", "Ha",
+ { "Hu", "HE", "DE", "SE", "MD", "Ha",
"HO", "Ko", "Mu", "Na", "Og", "Tr",
// the draconians
"Dr", "Dr", "Dr", "Dr", "Dr", "Dr", "Dr", "Dr", "Dr", "Dr",
@@ -129,7 +129,7 @@ int get_species_index_by_name( const char *name )
const char *get_species_abbrev(species_type which_species)
{
- ASSERT(which_species > 0 && which_species < NUM_SPECIES);
+ ASSERT(which_species >= 0 && which_species < NUM_SPECIES);
return (Species_Abbrev_List[which_species]);
}
@@ -139,7 +139,7 @@ species_type get_species_by_abbrev(const char *abbrev)
{
int i;
COMPILE_CHECK(ARRAYSZ(Species_Abbrev_List) == NUM_SPECIES, c1);
- for (i = SP_HUMAN; i < NUM_SPECIES; i++)
+ for (i = 0; i < NUM_SPECIES; i++)
{
if (tolower(abbrev[0]) == tolower(Species_Abbrev_List[i][0])
&& tolower(abbrev[1]) == tolower(Species_Abbrev_List[i][1]))
@@ -168,7 +168,7 @@ species_type str_to_species(const std::string &species)
return SP_UNKNOWN;
// first look for full name (e.g. Green Draconian)
- for (int i = SP_HUMAN; i < NUM_SPECIES; ++i)
+ for (int i = 0; i < NUM_SPECIES; ++i)
{
sp = static_cast<species_type>(i);
if (species == species_name(sp, 10))
@@ -176,7 +176,7 @@ species_type str_to_species(const std::string &species)
}
// nothing found, try again with plain name
- for (int i = SP_HUMAN; i < NUM_SPECIES; ++i)
+ for (int i = 0; i < NUM_SPECIES; ++i)
{
sp = static_cast<species_type>(i);
if (species == species_name(sp, 1))