- fixed crash on startup inside userinfo_t::GetGender()

This function is required for localization handling but when it's called userinfo_t may not be fully initialized yet

https://forum.zdoom.org/viewtopic.php?t=63959
This commit is contained in:
alexey.lysiuk 2019-03-15 13:12:53 +02:00
parent 50ebca20bb
commit c0d843b596

View file

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