mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 01:50:45 -05:00
Added patch to fix airdrops not spawning
This commit is contained in:
parent
7f05bd7e08
commit
9b53ad0752
25
project/SPT.Custom/Patches/AllowAirdropsInPvEPatch.cs
Normal file
25
project/SPT.Custom/Patches/AllowAirdropsInPvEPatch.cs
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -38,6 +38,7 @@ namespace SPT.Custom
|
|||||||
new FixScavWarNullErrorWithMarkOfUnknownPatch().Enable();
|
new FixScavWarNullErrorWithMarkOfUnknownPatch().Enable();
|
||||||
new MergeScavPmcQuestsOnInventoryLoadPatch().Enable();
|
new MergeScavPmcQuestsOnInventoryLoadPatch().Enable();
|
||||||
new CopyPmcQuestsToPlayerScavPatch().Enable();
|
new CopyPmcQuestsToPlayerScavPatch().Enable();
|
||||||
|
new AllowAirdropsInPvEPatch().Enable();
|
||||||
|
|
||||||
HookObject.AddOrGetComponent<MenuNotificationManager>();
|
HookObject.AddOrGetComponent<MenuNotificationManager>();
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using System.Reflection;
|
using EFT.UI;
|
||||||
using EFT.UI;
|
|
||||||
using SPT.Reflection.Patching;
|
using SPT.Reflection.Patching;
|
||||||
|
using System.Reflection;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace SPT.SinglePlayer.Patches.MainMenu;
|
namespace SPT.SinglePlayer.Patches.MainMenu;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user