- fixed: player_t::GetGender needs to check if the CVAR exists.

This function can get called before the player's userinfo is available
This commit is contained in:
Christoph Oelckers 2019-03-13 18:06:59 +01:00
parent 8dea4f9523
commit 613cf15b31

View file

@ -250,7 +250,8 @@ struct userinfo_t : TMap<FName,FBaseCVar *>
}
int GetGender() const
{
return *static_cast<FIntCVar *>(*CheckKey(NAME_Gender));
auto cvar = static_cast<FIntCVar *>(*CheckKey(NAME_Gender));
return cvar? *cvar : 0;
}
bool GetNoAutostartMap() const
{