diff --git a/project/Aki.Custom/Patches/ScavItemCheckmarkPatch.cs b/project/Aki.Custom/Patches/ScavItemCheckmarkPatch.cs index 7093524..0c85112 100644 --- a/project/Aki.Custom/Patches/ScavItemCheckmarkPatch.cs +++ b/project/Aki.Custom/Patches/ScavItemCheckmarkPatch.cs @@ -3,6 +3,8 @@ using System.Linq; using System.Reflection; using Aki.Reflection.Patching; using Aki.Reflection.Utils; +using Comfort.Common; +using EFT; using EFT.UI.DragAndDrop; using HarmonyLib; @@ -10,19 +12,30 @@ namespace Aki.Custom.Patches { public class ScavItemCheckmarkPatch : ModulePatch - { + { + /// + /// This patch runs both inraid and on main Menu everytime the inventory is loaded + /// Aim is to let Scavs see what required items your PMC needs for quests like Live using the FiR status + /// protected override MethodBase GetTargetMethod() { return AccessTools.Method(typeof(QuestItemViewPanel), nameof(QuestItemViewPanel.smethod_0)); } [PatchPrefix] - public static void PatchPreFix(ref IEnumerable quests) + private static void PatchPreFix(ref IEnumerable quests) { - var pmcQuests = PatchConstants.BackEndSession.Profile.QuestsData; - var scavQuests = PatchConstants.BackEndSession.ProfileOfPet.QuestsData; + var gameWorld = Singleton.Instance; - quests = pmcQuests.Concat(scavQuests); + if (gameWorld != null) + { + if (gameWorld.MainPlayer.Location != "hideout" && gameWorld.MainPlayer.Fraction == ETagStatus.Scav) + { + var pmcQuests = PatchConstants.BackEndSession.Profile.QuestsData; + var scavQuests = PatchConstants.BackEndSession.ProfileOfPet.QuestsData; + quests = pmcQuests.Concat(scavQuests); + } + } } } } \ No newline at end of file