diff --git a/Fika.Core/Networking/Models/FikaPlayerPresenceResponse.cs b/Fika.Core/Networking/Models/FikaPlayerPresenceResponse.cs index 829c9218..16de77ab 100644 --- a/Fika.Core/Networking/Models/FikaPlayerPresenceResponse.cs +++ b/Fika.Core/Networking/Models/FikaPlayerPresenceResponse.cs @@ -16,9 +16,9 @@ public struct FikaPlayerPresence public bool InRaid; [DataMember(Name = "raidInformation")] - public RaidInformation RaidInformation; + public RaidInformation? RaidInformation; - public FikaPlayerPresence(string nickname, int level, bool inRaid, RaidInformation raidInformation) + public FikaPlayerPresence(string nickname, int level, bool inRaid, RaidInformation? raidInformation) { Nickname = nickname; Level = level; diff --git a/Fika.Core/UI/Custom/MainMenuUIScript.cs b/Fika.Core/UI/Custom/MainMenuUIScript.cs index e25c9657..89c1f20c 100644 --- a/Fika.Core/UI/Custom/MainMenuUIScript.cs +++ b/Fika.Core/UI/Custom/MainMenuUIScript.cs @@ -92,12 +92,13 @@ private void SetupPlayers(ref FikaPlayerPresence[] responses) GameObject newPlayer = GameObject.Instantiate(playerTemplate, playerTemplate.transform.parent); MainMenuUIPlayer mainMenuUIPlayer = newPlayer.GetComponent(); mainMenuUIPlayer.SetStatus(presence.Nickname, presence.Level, presence.InRaid); - if (presence.InRaid) + if (presence.InRaid && presence.RaidInformation.HasValue) { - string side = presence.RaidInformation.Side == EFT.ESideType.Pmc ? "PMC" : "Scav"; + RaidInformation information = presence.RaidInformation.Value; + string side = information.Side == EFT.ESideType.Pmc ? "PMC" : "Scav"; TooltipTextGetter tooltipTextGetter = new() { - TooltipText = $"Playing as a {side} on {ColorUtils.ColorizeText(Colors.BLUE, presence.RaidInformation.Location.Localized())}" + TooltipText = $"Playing as a {side} on {ColorUtils.ColorizeText(Colors.BLUE, information.Location.Localized())}" }; HoverTooltipArea tooltip = newPlayer.AddComponent(); tooltip.enabled = true; diff --git a/Fika.Core/UI/Patches/TarkovApplication_method_18_Patch.cs b/Fika.Core/UI/Patches/TarkovApplication_method_18_Patch.cs index 3f75d498..f1b9f249 100644 --- a/Fika.Core/UI/Patches/TarkovApplication_method_18_Patch.cs +++ b/Fika.Core/UI/Patches/TarkovApplication_method_18_Patch.cs @@ -18,7 +18,7 @@ protected override MethodBase GetTargetMethod() } [PatchPostfix] - internal static void PatchPostfix() + internal static void Postfix() { Singleton.Instance.gameObject.AddComponent(); }