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

Additrional patch fixes for 24605

This commit is contained in:
Dev 2023-07-07 15:01:45 +01:00
parent 878f85a5b5
commit 610f5e596b
5 changed files with 17 additions and 25 deletions

View File

@ -25,7 +25,8 @@ namespace Aki.Custom
new BotDifficultyPatch().Enable();
new CoreDifficultyPatch().Enable();
new OfflineRaidMenuPatch().Enable();
new RaidSettingsWindowPatch().Enable();
// Fixed in live, no need for patch
//new RaidSettingsWindowPatch().Enable();
new OfflineRaidSettingsMenuPatch().Enable();
new SessionIdPatch().Enable();
new VersionLabelPatch().Enable();

View File

@ -49,9 +49,9 @@ namespace Aki.Custom.Patches
private static bool IsTargetMethod(MethodInfo mi)
{
var parameters = mi.GetParameters();
return (parameters.Length == 6
&& parameters[0].Name == "bundleLock"
&& parameters[1].Name == "defaultKey"
return (parameters.Length == 6
&& parameters[0].Name == "bundleLock"
&& parameters[1].Name == "defaultKey"
&& parameters[4].Name == "shouldExclude");
}

View File

@ -7,8 +7,8 @@ namespace Aki.PrePatch
{
public static IEnumerable<string> TargetDLLs { get; } = new[] { "Assembly-CSharp.dll" };
public static int sptUsecValue = 32;
public static int sptBearValue = 33;
public static int sptUsecValue = 33;
public static int sptBearValue = 34;
public static void Patch(ref AssemblyDefinition assembly)
{

View File

@ -36,9 +36,10 @@ namespace Aki.SinglePlayer.Patches.RaidFix
private bool IsTargetMethod(MethodInfo mi)
{
var parameters = mi.GetParameters();
return (parameters.Length == 2
return (parameters.Length == 3
&& parameters[0].Name == "data"
&& parameters[1].Name == "cancellationToken");
&& parameters[1].Name == "cancellationToken"
&& parameters[2].Name == "withDelete");
}
[PatchPrefix]

View File

@ -10,10 +10,10 @@ namespace Aki.SinglePlayer.Patches.RaidFix
{
public class RemoveUsedBotProfilePatch : ModulePatch
{
private static BindingFlags _flags;
private static Type _targetInterface;
private static Type _targetType;
private static FieldInfo _profilesField;
private static readonly BindingFlags _flags;
private static readonly Type _targetInterface;
private static readonly Type _targetType;
private static readonly FieldInfo _profilesField;
static RemoveUsedBotProfilePatch()
{
@ -41,21 +41,11 @@ namespace Aki.SinglePlayer.Patches.RaidFix
}
[PatchPrefix]
private static bool PatchPrefix(ref Profile __result, object __instance, IBotData data)
private static bool PatchPrefix(ref Profile __result, object __instance, GClass626 data, ref bool withDelete)
{
var profiles = (List<Profile>)_profilesField.GetValue(__instance);
withDelete = true;
if (profiles.Count > 0)
{
// second parameter makes client remove used profiles
__result = data.ChooseProfile(profiles, true);
}
else
{
__result = null;
}
return false;
return true; // Do original method
}
}
}