0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 09:50:43 -05:00
modules/project/SPT.SinglePlayer/Patches/ScavMode/ScavFoundInRaidPatch.cs

32 lines
803 B
C#
Raw Normal View History

using EFT;
using HarmonyLib;
using SPT.Reflection.Patching;
using System.Reflection;
namespace SPT.SinglePlayer.Patches.ScavMode
{
public class ScavFoundInRaidPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(GameWorld), nameof(GameWorld.OnGameStarted));
}
[PatchPrefix]
public static void PatchPrefix(GameWorld __instance)
{
var player = __instance.MainPlayer;
if (player == null || player.Profile.Side != EPlayerSide.Savage)
{
return;
}
foreach (var item in player.Profile.Inventory.AllRealPlayerItems)
{
item.SpawnedInSession = true;
}
}
}
}