Skip to content

Commit

Permalink
- fixed: player_t::GetGender needs to check if the CVAR exists.
Browse files Browse the repository at this point in the history
This function can get called before the player's userinfo is available
  • Loading branch information
coelckers committed Mar 13, 2019
1 parent 8dea4f9 commit 613cf15
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/d_player.h
Expand Up @@ -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
{
Expand Down

0 comments on commit 613cf15

Please sign in to comment.