From c0d843b5967bba506bbda10188156bcd7aa03c13 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 15 Mar 2019 13:12:53 +0200 Subject: [PATCH] - 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 --- src/d_player.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 4eae01926..d52e35979 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -250,8 +250,8 @@ struct userinfo_t : TMap } int GetGender() const { - auto cvar = static_cast(*CheckKey(NAME_Gender)); - return cvar? *cvar : 0; + auto cvar = CheckKey(NAME_Gender); + return cvar ? *static_cast(*cvar) : 0; } bool GetNoAutostartMap() const {