forked from CWX/CWX-mods
27 lines
631 B
C#
27 lines
631 B
C#
|
using Aki.Reflection.Patching;
|
|||
|
using EFT;
|
|||
|
using System.Reflection;
|
|||
|
using System;
|
|||
|
|
|||
|
namespace AirDrop
|
|||
|
{
|
|||
|
public class Patch : ModulePatch
|
|||
|
{
|
|||
|
protected override MethodBase GetTargetMethod()
|
|||
|
{
|
|||
|
var result = typeof(GameWorld).GetMethod("OnGameStarted", BindingFlags.Public | BindingFlags.Instance);
|
|||
|
|
|||
|
return result;
|
|||
|
}
|
|||
|
[PatchPostfix]
|
|||
|
public static void PatchPostFix()
|
|||
|
{
|
|||
|
int chance = AirDrop.RandomChanceGen(1, 99);
|
|||
|
if (chance <= AirDrop.dropChance)
|
|||
|
{
|
|||
|
AirDrop.InitObjects();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|