0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-12 20:50:44 -05:00

Added patch to fix airdrops not spawning

This commit is contained in:
Dev 2024-09-03 12:36:49 +01:00
parent 7f05bd7e08
commit 9b53ad0752
3 changed files with 28 additions and 2 deletions

View File

@ -0,0 +1,25 @@
using System.Reflection;
using SPT.Reflection.Patching;
namespace SPT.Custom.Patches
{
/// <summary>
/// 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
/// </summary>
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
}
}
}

View File

@ -38,6 +38,7 @@ namespace SPT.Custom
new FixScavWarNullErrorWithMarkOfUnknownPatch().Enable();
new MergeScavPmcQuestsOnInventoryLoadPatch().Enable();
new CopyPmcQuestsToPlayerScavPatch().Enable();
new AllowAirdropsInPvEPatch().Enable();
HookObject.AddOrGetComponent<MenuNotificationManager>();
}

View File

@ -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;