2024-09-03 12:36:49 +01:00
|
|
|
|
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()
|
|
|
|
|
{
|
2024-10-31 17:19:37 +00:00
|
|
|
|
return typeof(GClass2404).GetProperty(nameof(GClass2404.Int32_0)).GetGetMethod();
|
2024-09-03 12:36:49 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[PatchPrefix]
|
|
|
|
|
public static bool PatchPrefix(ref int __result)
|
|
|
|
|
{
|
|
|
|
|
__result = 1;
|
|
|
|
|
|
|
|
|
|
return false; // Skip original
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|