Fix get random value from baselibrary returning key instead of value.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-04-19 18:22:27 +02:00
parent aeac49d892
commit b286d1726d
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 2 additions and 2 deletions

View File

@ -58,12 +58,12 @@ namespace CreatureLib::Library {
inline const T* GetRandomValue(Arbutils::Random rand = Arbutils::Random()) const {
auto i = rand.Get(_values.Count());
auto& map = _values.GetStdMap();
return std::next(std::begin(map), i)->first;
return std::next(std::begin(map), i)->second;
}
inline const T* GetRandomValue(Arbutils::Random* rand) const {
auto i = rand->Get(_values.Count());
auto& map = _values.GetStdMap();
return std::next(std::begin(map), i)->first;
return std::next(std::begin(map), i)->second;
}
};
}