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/ScavPrestigeFixPatch.cs

31 lines
971 B
C#
Raw Normal View History

2024-12-27 15:02:07 +00:00
using System;
using System.Reflection;
using EFT;
using EFT.InventoryLogic;
using HarmonyLib;
using SPT.Reflection.Patching;
using SPT.Reflection.Utils;
namespace SPT.SinglePlayer.Patches.ScavMode;
/// <summary>
/// The game is not accepting Scav profiles for the PrestigeController,
/// as a workaround we give the PMC profile so we can get in-raid as a scav
/// this may cause issues with the Prestige system if/when implemented
/// </summary>
public class ScavPrestigeFixPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
2025-02-07 09:35:47 +00:00
return AccessTools.Constructor(typeof(GClass3693), new Type[] { typeof(Profile), typeof(InventoryController), typeof(GClass3869), typeof(ISession) }, false);
2024-12-27 15:02:07 +00:00
}
[PatchPrefix]
2025-01-30 12:18:13 +00:00
public static void PatchPrefix(GClass3693 __instance, ref Profile profile)
2024-12-27 15:02:07 +00:00
{
if (profile.Side == EPlayerSide.Savage)
{
profile = PatchConstants.BackEndSession.Profile;
}
}
}