diff --git a/Barotrauma/BarotraumaClient/Source/Screens/CampaignSetupUI.cs b/Barotrauma/BarotraumaClient/Source/Screens/CampaignSetupUI.cs index 578ee4bf0..b5f920245 100644 --- a/Barotrauma/BarotraumaClient/Source/Screens/CampaignSetupUI.cs +++ b/Barotrauma/BarotraumaClient/Source/Screens/CampaignSetupUI.cs @@ -57,6 +57,14 @@ namespace Barotrauma Submarine selectedSub = subList.SelectedData as Submarine; if (selectedSub == null) return false; + + if (string.IsNullOrEmpty(selectedSub.MD5Hash.Hash)) + { + ((GUITextBlock)subList.Selected).TextColor = Color.DarkRed * 0.8f; + subList.Selected.CanBeFocused = false; + subList.Deselect(); + return false; + } string savePath = SaveUtil.CreateSavePath(isMultiplayer ? SaveUtil.SaveType.Multiplayer : SaveUtil.SaveType.Singleplayer, saveNameBox.Text); if (selectedSub.HasTag(SubmarineTag.Shuttle) || !selectedSub.CompatibleContentPackages.Contains(GameMain.SelectedPackage.Name)) diff --git a/Barotrauma/BarotraumaClient/Source/Screens/NetLobbyScreen.cs b/Barotrauma/BarotraumaClient/Source/Screens/NetLobbyScreen.cs index c75161cb0..4240e64ea 100644 --- a/Barotrauma/BarotraumaClient/Source/Screens/NetLobbyScreen.cs +++ b/Barotrauma/BarotraumaClient/Source/Screens/NetLobbyScreen.cs @@ -737,10 +737,11 @@ namespace Barotrauma //hash will be null if opening the sub file failed -> don't select the sub if (string.IsNullOrWhiteSpace(hash)) { - if (component is GUITextBlock textBlock) + GUITextBlock submarineTextBlock = component.GetChild(); + if (submarineTextBlock != null) { - textBlock.TextColor = Color.DarkRed * 0.8f; - textBlock.CanBeFocused = false; + submarineTextBlock.TextColor = Color.DarkRed * 0.8f; + submarineTextBlock.CanBeFocused = false; } else {