2024-09-16 18:18:52 +00:00
|
|
|
|
using EFT;
|
|
|
|
|
using HarmonyLib;
|
|
|
|
|
using SPT.Reflection.Patching;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
|
|
|
|
|
namespace SPT.SinglePlayer.Patches.MainMenu
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// This patch ensures that the gamemode is always <see cref="ERaidMode.Local"/> and that IsPveOffline is always true when starting a game<br/>
|
|
|
|
|
/// This prevents a bug where the gameworld is instantiated as an online world
|
|
|
|
|
/// </summary>
|
2024-11-17 15:44:18 +00:00
|
|
|
|
public class ForceRaidModeToLocalPatch : ModulePatch
|
2024-09-16 18:18:52 +00:00
|
|
|
|
{
|
|
|
|
|
protected override MethodBase GetTargetMethod()
|
|
|
|
|
{
|
|
|
|
|
return AccessTools.Method(typeof(TarkovApplication), nameof(TarkovApplication.method_41));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[PatchPrefix]
|
|
|
|
|
public static void Prefix(ref RaidSettings ____raidSettings)
|
|
|
|
|
{
|
|
|
|
|
____raidSettings.RaidMode = ERaidMode.Local;
|
|
|
|
|
____raidSettings.IsPveOffline = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|