2024-07-08 15:44:45 +01:00
|
|
|
|
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]
|
2024-08-02 16:57:59 +01:00
|
|
|
|
public static void PatchPrefix(GameWorld __instance)
|
2024-07-08 15:44:45 +01:00
|
|
|
|
{
|
|
|
|
|
var player = __instance.MainPlayer;
|
|
|
|
|
|
|
|
|
|
if (player == null || player.Profile.Side != EPlayerSide.Savage)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (var item in player.Profile.Inventory.AllRealPlayerItems)
|
|
|
|
|
{
|
|
|
|
|
item.SpawnedInSession = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|