2023-04-08 17:59:17 +01:00
|
|
|
|
using Aki.Reflection.Patching;
|
|
|
|
|
using Comfort.Common;
|
|
|
|
|
using EFT;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
|
|
|
|
|
namespace CWX_AlarmChanger
|
|
|
|
|
{
|
|
|
|
|
public class AlarmChangerPatch : ModulePatch
|
|
|
|
|
{
|
|
|
|
|
protected override MethodBase GetTargetMethod()
|
|
|
|
|
{
|
|
|
|
|
return typeof(GameWorld).GetMethod("OnGameStarted", BindingFlags.Public | BindingFlags.Instance);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[PatchPostfix]
|
|
|
|
|
public static void PatchPostFix()
|
|
|
|
|
{
|
|
|
|
|
var gameWorld = Singleton<GameWorld>.Instance;
|
|
|
|
|
|
2023-10-06 18:46:03 +01:00
|
|
|
|
if (gameWorld == null || gameWorld.MainPlayer.Location.ToLower() != "rezervbase") return;
|
|
|
|
|
|
|
|
|
|
AlarmChanger.CWX_Component.Init();
|
2023-04-08 17:59:17 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|