0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 09:50:43 -05:00
modules/project/SPT.SinglePlayer/Patches/MainMenu/AmmoUsedCounterPatch.cs

25 lines
649 B
C#

using SPT.Reflection.Patching;
using EFT;
using HarmonyLib;
using System.Reflection;
namespace SPT.SinglePlayer.Patches.MainMenu
{
public class AmmoUsedCounterPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(Player), nameof(Player.OnMakingShot));
}
[PatchPostfix]
public static void PatchPostfix(Player __instance)
{
if (__instance.IsYourPlayer)
{
__instance.Profile.EftStats.SessionCounters.AddLong(1L, SessionCounterTypesAbstractClass.AmmoUsed);
}
}
}
}