Fixed errors in netlobbyscreen when attempting to select a sub that fails to load (for example due to a missing/corrupt file), campaign cannot be started if the selected submarine cannot be loaded

This commit is contained in:
Joonas Rikkonen
2018-08-06 14:28:54 +03:00
parent 1a50996774
commit 7c93730fc3
2 changed files with 12 additions and 3 deletions
@@ -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<GUITextBlock>();
if (submarineTextBlock != null)
{
textBlock.TextColor = Color.DarkRed * 0.8f;
textBlock.CanBeFocused = false;
submarineTextBlock.TextColor = Color.DarkRed * 0.8f;
submarineTextBlock.CanBeFocused = false;
}
else
{