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

update Playerscavpatch

This commit is contained in:
Kaeno 2024-07-08 18:52:57 +01:00
parent 01631c6060
commit cd76273abc

View File

@ -8,18 +8,24 @@ namespace SPT.SinglePlayer.Patches.ScavMode
public class EnablePlayerScavPatch : ModulePatch public class EnablePlayerScavPatch : ModulePatch
{ {
/// <summary> /// <summary>
/// Change Raid Mode to local and ForceOnlineRaidInPVE to true to allow loading in as a scav /// Temporarily trick client into thinking we are PMC and in offline mode to allow loading of scavs in PVE mode
/// </summary> /// </summary>
protected override MethodBase GetTargetMethod() protected override MethodBase GetTargetMethod()
{ {
return AccessTools.Method(typeof(MainMenuController), nameof(MainMenuController.method_22)); return AccessTools.Method(typeof(MainMenuController), nameof(MainMenuController.method_22));
} }
[PatchPostfix] [PatchPrefix]
private static void PatchPostfix(ref MainMenuController __instance, ref RaidSettings ___raidSettings_0, ref ISession ___iSession) private static void PatchPrefix(ref RaidSettings ___raidSettings_0)
{ {
___raidSettings_0.RaidMode = ERaidMode.Local; ___raidSettings_0.RaidMode = ERaidMode.Local;
___raidSettings_0.SelectedLocation.ForceOnlineRaidInPVE = true; ___raidSettings_0.IsPveOffline = true;
}
[PatchPostfix]
private static void PatchPostfix(ref RaidSettings ___raidSettings_0)
{
___raidSettings_0.RaidMode = ERaidMode.Online;
___raidSettings_0.IsPveOffline = true;
} }
} }
} }