diff --git a/project/SPT.SinglePlayer/Patches/MainMenu/FixLocalRaidPatch.cs b/project/SPT.SinglePlayer/Patches/MainMenu/FixLocalRaidPatch.cs new file mode 100644 index 0000000..01268cb --- /dev/null +++ b/project/SPT.SinglePlayer/Patches/MainMenu/FixLocalRaidPatch.cs @@ -0,0 +1,26 @@ +using EFT; +using HarmonyLib; +using SPT.Reflection.Patching; +using System.Reflection; + +namespace SPT.SinglePlayer.Patches.MainMenu +{ + /// + /// This patch ensures that the gamemode is always and that IsPveOffline is always true when starting a game
+ /// This prevents a bug where the gameworld is instantiated as an online world + ///
+ public class FixLocalRaidPatch : ModulePatch + { + 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; + } + } +} diff --git a/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs b/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs index 5a39310..8d79316 100644 --- a/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs +++ b/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs @@ -59,6 +59,7 @@ namespace SPT.SinglePlayer //new InsuranceScreenPatch().Enable(); new RemoveStashUpgradeLabelPatch().Enable(); new RemoveClothingItemExternalObtainLabelPatch().Enable(); + new FixLocalRaidPatch().Enable(); } catch (Exception ex) {