mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 09:50:43 -05:00
- Move clearing trader service data to raid end instead of as part of BTR Manager - Fix data type for TraderServices ItemsToPay property - Add ItemsToReceive property to TraderServices (Used for LK amulet) - Don't throw NRE when nothing is bound to OnTraderServicePurchased Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com> Reviewed-on: SPT-AKI/Modules#79 Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com> Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
28 lines
707 B
C#
28 lines
707 B
C#
using Aki.Reflection.Patching;
|
|
using Aki.SinglePlayer.Utils.TraderServices;
|
|
using Comfort.Common;
|
|
using EFT;
|
|
using System.Reflection;
|
|
|
|
namespace Aki.SinglePlayer.Patches.TraderServices
|
|
{
|
|
public class LightKeeperServicesPatch : ModulePatch
|
|
{
|
|
protected override MethodBase GetTargetMethod()
|
|
{
|
|
return typeof(GameWorld).GetMethod(nameof(GameWorld.OnGameStarted));
|
|
}
|
|
|
|
[PatchPostfix]
|
|
public static void PatchPostFix()
|
|
{
|
|
var gameWorld = Singleton<GameWorld>.Instance;
|
|
|
|
if (gameWorld != null)
|
|
{
|
|
gameWorld.gameObject.AddComponent<LightKeeperServicesManager>();
|
|
}
|
|
}
|
|
}
|
|
}
|