diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-10-23 18:35:26 +0200 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-10-23 20:30:14 +0200 |
commit | 921c44bb1d1e0ddea50fffe518a214f626a9d11b (patch) | |
tree | da74349e851e7f1efcc42ed30e354d12e23935dd | |
parent | bea4408fe95cd8660cafc4dbedba321ebc4f0b12 (diff) | |
download | crawl-ref-921c44bb1d1e0ddea50fffe518a214f626a9d11b.tar.gz crawl-ref-921c44bb1d1e0ddea50fffe518a214f626a9d11b.zip |
Assert get_species argument.
-rw-r--r-- | crawl-ref/source/species.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crawl-ref/source/species.cc b/crawl-ref/source/species.cc index d55f871851..ab0556945d 100644 --- a/crawl-ref/source/species.cc +++ b/crawl-ref/source/species.cc @@ -61,8 +61,7 @@ species_type random_draconian_player_species() species_type get_species(const int index) { - if (index < 0 || (unsigned int) index >= ARRAYSZ(old_species_order)) - return (SP_UNKNOWN); + ASSERT(index >= 0 && index < ARRAYSZ(old_species_order)); return (Options.use_old_selection_order ? old_species_order[index] : new_species_order[index]); @@ -127,7 +126,7 @@ int get_species_index_by_name( const char *name ) return (sp); } -const char *get_species_abbrev( int which_species ) +const char *get_species_abbrev(int which_species) { ASSERT( which_species > 0 && which_species < NUM_SPECIES ); @@ -135,7 +134,7 @@ const char *get_species_abbrev( int which_species ) } // Needed for debug.cc and hiscores.cc. -int get_species_by_abbrev( const char *abbrev ) +int get_species_by_abbrev(const char *abbrev) { int i; COMPILE_CHECK(ARRAYSZ(Species_Abbrev_List) == NUM_SPECIES, c1); |