diff --git a/GbxMapBrowser/MapInfo.cs b/GbxMapBrowser/MapInfo.cs index b93664f..6969524 100644 --- a/GbxMapBrowser/MapInfo.cs +++ b/GbxMapBrowser/MapInfo.cs @@ -73,7 +73,11 @@ public MapInfo(string fullnamepath, bool basicInfoOnly) ? enviImagePath : new Uri(Environment.CurrentDirectory + "\\Data\\Environments\\Unknown.png"); - bool isRace = challenge.Mode == CGameCtnChallenge.PlayMode.Race || challenge.MapType.EndsWith("Race"); + MapType = string.IsNullOrEmpty(challenge.ChallengeParameters?.MapType) + ? challenge.Mode.ToString() + : challenge.ChallengeParameters.MapType; + + bool isRace = challenge.Mode == CGameCtnChallenge.PlayMode.Race || MapType.EndsWith("Race"); ObjectiveAuthor = !string.IsNullOrEmpty(challenge.ObjectiveTextAuthor) && !isRace ? challenge.ObjectiveTextAuthor @@ -97,10 +101,6 @@ public MapInfo(string fullnamepath, bool basicInfoOnly) CopperPrice = challenge.Cost.ToString(); - MapType = string.IsNullOrEmpty(challenge.ChallengeParameters.MapType) - ? challenge.Mode.ToString() - : challenge.ChallengeParameters.MapType; - if (challenge.Thumbnail == null) { MapThumbnail = new BitmapImage(new Uri(Environment.CurrentDirectory + "\\Data\\UIIcons\\NoThumbnail.png"));