mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 06:10:45 -05:00
Removed LocationLootCacheBustingPatch
, targeted method is no longer used and loot is no longer cached on the client
This commit is contained in:
parent
920d73209c
commit
5131a6ff68
@ -1,42 +0,0 @@
|
|||||||
using SPT.Reflection.Patching;
|
|
||||||
using SPT.Reflection.Utils;
|
|
||||||
using System.Reflection;
|
|
||||||
using EFT;
|
|
||||||
using HarmonyLib;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace SPT.Custom.Patches
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// BaseLocalGame appears to cache a maps loot data and reuse it when the variantId from method_6 is the same, this patch exits the method early, never caching the data
|
|
||||||
/// </summary>
|
|
||||||
public class LocationLootCacheBustingPatch : ModulePatch
|
|
||||||
{
|
|
||||||
protected override MethodBase GetTargetMethod()
|
|
||||||
{
|
|
||||||
var desiredType = typeof(BaseLocalGame<EftGamePlayerOwner>);
|
|
||||||
var desiredMethod = desiredType.GetMethods(BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.Public).SingleCustom(IsTargetMethod); // method_6
|
|
||||||
|
|
||||||
Logger.LogDebug($"{this.GetType().Name} Type: {desiredType?.Name}");
|
|
||||||
Logger.LogDebug($"{this.GetType().Name} Method: {desiredMethod?.Name}");
|
|
||||||
|
|
||||||
return desiredMethod;
|
|
||||||
}
|
|
||||||
|
|
||||||
// method_6
|
|
||||||
private static bool IsTargetMethod(MethodInfo mi)
|
|
||||||
{
|
|
||||||
var parameters = mi.GetParameters();
|
|
||||||
return parameters.Length == 3
|
|
||||||
&& parameters[0].Name == "backendUrl"
|
|
||||||
&& parameters[1].Name == "locationId"
|
|
||||||
&& parameters[2].Name == "variantId";
|
|
||||||
}
|
|
||||||
|
|
||||||
[PatchPrefix]
|
|
||||||
private static bool PatchPrefix()
|
|
||||||
{
|
|
||||||
return false; // skip original
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -50,7 +50,6 @@ namespace SPT.Custom
|
|||||||
new CoreDifficultyPatch().Enable();
|
new CoreDifficultyPatch().Enable();
|
||||||
new BotDifficultyPatch().Enable();
|
new BotDifficultyPatch().Enable();
|
||||||
new BossSpawnChancePatch().Enable();
|
new BossSpawnChancePatch().Enable();
|
||||||
new LocationLootCacheBustingPatch().Enable();
|
|
||||||
new VersionLabelPatch().Enable();
|
new VersionLabelPatch().Enable();
|
||||||
new FixBotgroupMarkofTheUnknown().Enable();
|
new FixBotgroupMarkofTheUnknown().Enable();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user