From 613cf15b31ffcdcd794708e20a13c4f3dcc2230a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 13 Mar 2019 18:06:59 +0100 Subject: [PATCH] - fixed: player_t::GetGender needs to check if the CVAR exists. This function can get called before the player's userinfo is available --- src/d_player.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 {