SMSMod-CurrencyChanger2/Patches/PriceManager_ChangeCurrentCost_Patch.cs
2025-06-08 21:38:33 +02:00

14 lines
489 B
C#

using HarmonyLib;
using System.Linq;
namespace CurrencyChanger2.Patches
{
[HarmonyPatch(typeof(PriceManager), "ChangeCurrentCost")]
public static class PriceManager_ChangeCurrentCost_Patch
{
public static void Postfix(int productID, PriceManager __instance)
{
if(PriceChanger.Override.Value) PriceChanger.ConfigEntries[productID].Value = __instance.m_CurrentCosts.FirstOrDefault((Pricing i) => i.ProductID == productID).Price;
}
}
}