diff --git a/NewHorizons/External/Configs/TitleScreenConfig.cs b/NewHorizons/External/Configs/TitleScreenConfig.cs index e08046ed..51541721 100644 --- a/NewHorizons/External/Configs/TitleScreenConfig.cs +++ b/NewHorizons/External/Configs/TitleScreenConfig.cs @@ -88,8 +88,8 @@ namespace NewHorizons.External.Configs /// public object extras; - public bool KnowsFact() => string.IsNullOrEmpty(factRequiredForTitle) || ShipLogHandler.KnowsFact(factRequiredForTitle); + public bool KnowsFact() => string.IsNullOrEmpty(factRequiredForTitle) || StandaloneProfileManager.SharedInstance.currentProfile != null && ShipLogHandler.KnowsFact(factRequiredForTitle); - public bool HasCondition() => string.IsNullOrEmpty(conditionRequiredForTitle) || PlayerData.GetPersistentCondition(conditionRequiredForTitle); + public bool HasCondition() => string.IsNullOrEmpty(conditionRequiredForTitle) || StandaloneProfileManager.SharedInstance.currentProfile != null && PlayerData.GetPersistentCondition(conditionRequiredForTitle); } } diff --git a/NewHorizons/Handlers/TitleSceneHandler.cs b/NewHorizons/Handlers/TitleSceneHandler.cs index 620494ff..f441abd6 100644 --- a/NewHorizons/Handlers/TitleSceneHandler.cs +++ b/NewHorizons/Handlers/TitleSceneHandler.cs @@ -34,10 +34,12 @@ namespace NewHorizons.Handlers var profileManager = StandaloneProfileManager.SharedInstance; profileManager.PreInitialize(); profileManager.Initialize(); - PlayerData.Init(profileManager.currentProfileGameSave, - profileManager.currentProfileGameSettings, - profileManager.currentProfileGraphicsSettings, - profileManager.currentProfileInputJSON); + if (profileManager.currentProfile != null) + PlayerData.Init(profileManager.currentProfileGameSave, + profileManager.currentProfileGameSettings, + profileManager.currentProfileGraphicsSettings, + profileManager.currentProfileInputJSON); + // TODO: Select one title screen and if it has shareTitleScreen set to true do all the other ones that have it true too. var (mod, config) = Main.TitleScreenConfigs.FirstOrDefault(kvp => kvp.Value.KnowsFact() && kvp.Value.HasCondition());