0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 09:30:46 -05:00
Lacyway 9b57469707 Add FixLocalRaidPatch (!167)
This patch ensures that the game mode is _always_ Local and PvE if the player skips the raid settings window. This way an online `GameWorld` will not be incorrectly instantiated.
**NOTE**: This might make EnablePlayerScavPatch redundant or at least parts of it.

Co-authored-by: Lacyway <20912169+Lacyway@users.noreply.github.com>
Reviewed-on: SPT/Modules#167
Co-authored-by: Lacyway <lacyway@noreply.dev.sp-tarkov.com>
Co-committed-by: Lacyway <lacyway@noreply.dev.sp-tarkov.com>
2024-09-16 18:18:52 +00:00

27 lines
774 B
C#

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>
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;
}
}
}