0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 08:50:43 -05:00
modules/project/SPT.Custom/Patches/AllowAirdropsInPvEPatch.cs
2024-10-31 17:19:37 +00:00

25 lines
744 B
C#

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(GClass2404).GetProperty(nameof(GClass2404.Int32_0)).GetGetMethod();
}
[PatchPrefix]
public static bool PatchPrefix(ref int __result)
{
__result = 1;
return false; // Skip original
}
}
}