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

26 lines
772 B
C#
Raw Normal View History

using Aki.Reflection.Patching;
using Aki.SinglePlayer.Utils.TraderServices;
using HarmonyLib;
using System.Reflection;
namespace Aki.SinglePlayer.Patches.TraderServices
{
public class GetTraderServicesPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(InventoryControllerClass), nameof(InventoryControllerClass.GetTraderServicesDataFromServer));
}
[PatchPrefix]
public static bool PatchPrefix(string traderId)
{
Logger.LogInfo($"Loading {traderId} services from servers");
TraderServicesManager.Instance.GetTraderServicesDataFromServer(traderId);
// Skip original
return false;
}
}
}