mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 09:50:43 -05:00
32 lines
803 B
C#
32 lines
803 B
C#
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;
|
|
}
|
|
}
|
|
}
|
|
}
|