CWX-mods/Live/CWX_AlarmChanger/AlarmChangerPatch.cs

26 lines
667 B
C#
Raw Normal View History

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();
}
}
}