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()
|
|
|
|
|
{
|
2025-01-30 13:58:29 +01:00
|
|
|
|
return typeof(GClass2454).GetProperty(nameof(GClass2454.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
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|