0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 09:50:43 -05:00

35 lines
927 B
C#
Raw Normal View History

2024-05-21 19:10:17 +01:00
using SPT.Reflection.Patching;
using SPT.SinglePlayer.Models.Progression;
2023-03-03 18:52:31 +00:00
using Comfort.Common;
using EFT;
using System.Reflection;
using HarmonyLib;
2023-03-03 18:52:31 +00:00
2024-05-21 19:10:17 +01:00
namespace SPT.SinglePlayer.Patches.Progression
2023-03-03 18:52:31 +00:00
{
public class LighthouseBridgePatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(GameWorld), nameof(GameWorld.OnGameStarted));
2023-03-03 18:52:31 +00:00
}
[PatchPostfix]
private static void PatchPostfix()
{
var gameWorld = Singleton<GameWorld>.Instance;
if (gameWorld == null)
{
return;
}
if (gameWorld.MainPlayer.Location.ToLower() != "lighthouse" || gameWorld.MainPlayer.Side == EPlayerSide.Savage)
{
return;
}
2023-03-03 18:52:31 +00:00
gameWorld.GetOrAddComponent<LighthouseProgressionClass>();
}
2023-03-03 18:52:31 +00:00
}
}