Skip to content
Permalink
Browse files

- 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
  • Loading branch information...
alexey-lysiuk committed Mar 15, 2019
1 parent 50ebca2 commit c0d843b5967bba506bbda10188156bcd7aa03c13
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/d_player.h
@@ -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
{

0 comments on commit c0d843b

Please sign in to comment.
You can’t perform that action at this time.