Skip to content

Commit

Permalink
- fixed crash on startup inside userinfo_t::GetGender()
Browse files Browse the repository at this point in the history
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 c0d843b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/d_player.h
Expand Up @@ -250,8 +250,8 @@ struct userinfo_t : TMap<FName,FBaseCVar *>
} }
int GetGender() const int GetGender() const
{ {
auto cvar = static_cast<FIntCVar *>(*CheckKey(NAME_Gender)); auto cvar = CheckKey(NAME_Gender);
return cvar? *cvar : 0; return cvar ? *static_cast<FIntCVar *>(*cvar) : 0;
} }
bool GetNoAutostartMap() const bool GetNoAutostartMap() const
{ {
Expand Down

0 comments on commit c0d843b

Please sign in to comment.