diff --git a/project/SPT.Custom/Patches/AllowAirdropsInPvEPatch.cs b/project/SPT.Custom/Patches/AllowAirdropsInPvEPatch.cs new file mode 100644 index 0000000..ddc839f --- /dev/null +++ b/project/SPT.Custom/Patches/AllowAirdropsInPvEPatch.cs @@ -0,0 +1,25 @@ +using System.Reflection; +using SPT.Reflection.Patching; + +namespace SPT.Custom.Patches +{ + /// + /// Every maps base.json config from BSG come with a "MinPlayersCountToSpawnAirdrop" property value of 6, + /// this patch sets the associated property to always return 1 regardless of what config says + /// + public class AllowAirdropsInPvEPatch : ModulePatch + { + protected override MethodBase GetTargetMethod() + { + return typeof(GClass2304).GetProperty(nameof(GClass2304.Int32_0)).GetGetMethod(); + } + + [PatchPrefix] + public static bool PatchPrefix(ref int __result) + { + __result = 1; + + return false; // Skip original + } + } +} \ No newline at end of file diff --git a/project/SPT.Custom/SPTCustomPlugin.cs b/project/SPT.Custom/SPTCustomPlugin.cs index de9cb3b..003de9f 100644 --- a/project/SPT.Custom/SPTCustomPlugin.cs +++ b/project/SPT.Custom/SPTCustomPlugin.cs @@ -38,6 +38,7 @@ namespace SPT.Custom new FixScavWarNullErrorWithMarkOfUnknownPatch().Enable(); new MergeScavPmcQuestsOnInventoryLoadPatch().Enable(); new CopyPmcQuestsToPlayerScavPatch().Enable(); + new AllowAirdropsInPvEPatch().Enable(); HookObject.AddOrGetComponent(); } diff --git a/project/SPT.SinglePlayer/Patches/MainMenu/RemoveStashUpgradeLabelPatch.cs b/project/SPT.SinglePlayer/Patches/MainMenu/RemoveStashUpgradeLabelPatch.cs index 0362b96..f7881be 100644 --- a/project/SPT.SinglePlayer/Patches/MainMenu/RemoveStashUpgradeLabelPatch.cs +++ b/project/SPT.SinglePlayer/Patches/MainMenu/RemoveStashUpgradeLabelPatch.cs @@ -1,6 +1,6 @@ -using System.Reflection; -using EFT.UI; +using EFT.UI; using SPT.Reflection.Patching; +using System.Reflection; using UnityEngine; namespace SPT.SinglePlayer.Patches.MainMenu;