diff --git a/src/d_player.h b/src/d_player.h index fdcd29e6a4..4eae01926e 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -250,7 +250,8 @@ struct userinfo_t : TMap } int GetGender() const { - return *static_cast(*CheckKey(NAME_Gender)); + auto cvar = static_cast(*CheckKey(NAME_Gender)); + return cvar? *cvar : 0; } bool GetNoAutostartMap() const {