Implements genderless mons.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-06-10 12:16:09 +02:00
parent fc74a7d4bd
commit fccf339e76
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 3 additions and 1 deletions

View File

@ -37,7 +37,9 @@ void CreatureSpecies::SetVariant(const ArbUt::CaseInsensitiveConstString& name,
}
Gender CreatureSpecies::GetRandomGender(ArbUt::Random& rand) const {
// TODO: Genderless creatures
if (this->_genderRate == -1) {
return Gender::Genderless;
}
auto val = rand.GetDouble();
if (val >= this->_genderRate)
return Gender ::Female;