mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 09:50:43 -05:00
26 lines
772 B
C#
26 lines
772 B
C#
using SPT.Reflection.Patching;
|
|
using SPT.SinglePlayer.Utils.TraderServices;
|
|
using HarmonyLib;
|
|
using System.Reflection;
|
|
|
|
namespace SPT.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;
|
|
}
|
|
}
|
|
}
|