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

harden method against client changes

This commit is contained in:
Chomp 2025-01-06 17:35:35 +00:00
parent c05644c5aa
commit 0dbcd5e764

View File

@ -8,6 +8,7 @@ namespace SPT.SinglePlayer.Patches.MainMenu
/// <summary> /// <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 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 /// This prevents a bug where the gameworld is instantiated as an online world
/// One outcome of not having this patch is grenades do not explode after being thrown
/// </summary> /// </summary>
public class ForceRaidModeToLocalPatch : ModulePatch public class ForceRaidModeToLocalPatch : ModulePatch
{ {
@ -17,7 +18,7 @@ namespace SPT.SinglePlayer.Patches.MainMenu
} }
[PatchPrefix] [PatchPrefix]
public static void Prefix(ref RaidSettings ____raidSettings) public static void Prefix(ref RaidSettings ____raidSettings, bool canEscape)
{ {
____raidSettings.RaidMode = ERaidMode.Local; ____raidSettings.RaidMode = ERaidMode.Local;
____raidSettings.IsPveOffline = true; ____raidSettings.IsPveOffline = true;