From 9d69ea03a92d200d047531e5c288274dcc7a2690 Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Sat, 24 Oct 2009 09:57:33 +0200 Subject: Fix Humans not being selectable on character selection. --- crawl-ref/source/newgame.cc | 12 +++++------- crawl-ref/source/species.cc | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc index b69c5468e5..b102608ff0 100644 --- a/crawl-ref/source/newgame.cc +++ b/crawl-ref/source/newgame.cc @@ -223,7 +223,7 @@ int give_first_conjuration_book() // primarily used to suppress the display of the draconian variants. static bool _is_species_valid_choice(species_type species, bool display = true) { - if (!species) // Species only start at 1. + if (species < 0 || species > NUM_SPECIES) return (false); if (species >= SP_ELF) // These are all invalid. @@ -4188,8 +4188,8 @@ spec_query: textcolor( LIGHTGREY ); - int j = 0; - for (int i = 0; i < ng_num_species(); ++i) + int i = -1; + for (i = 0; i < ng_num_species(); ++i) { const species_type si = get_species(i); @@ -4221,17 +4221,15 @@ spec_query: cprintf("%c - %s", sletter, species_name(si, 1).c_str()); } - if (j % 2) + if (i % 2) cprintf(EOL); else cgotoxy(31, wherey()); textcolor(LIGHTGREY); // Reset text colour. - - j++; } - if (j % 2) + if (i % 2) cprintf(EOL); textcolor( BROWN ); diff --git a/crawl-ref/source/species.cc b/crawl-ref/source/species.cc index 02cc3f4c38..cc01bba653 100644 --- a/crawl-ref/source/species.cc +++ b/crawl-ref/source/species.cc @@ -96,7 +96,7 @@ int get_species_index_by_abbrev(const char *abbrev) return (-1); } -int get_species_index_by_name( const char *name ) +int get_species_index_by_name(const char *name) { unsigned int i; int sp = -1; @@ -115,7 +115,7 @@ int get_species_index_by_name( const char *name ) const std::string lowered_species = lowercase_string(species_name(real_sp,1)); - pos = lowered_species.find( lowered_buff ); + pos = lowered_species.find(lowered_buff); if (pos != std::string::npos) { sp = i; -- cgit v1.2.3-54-g00ecf