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#
Raw Permalink Normal View History

2024-05-21 19:10:17 +01:00
using SPT.Reflection.Patching;
2024-03-21 11:04:53 +00:00
using EFT;
using HarmonyLib;
using System.Reflection;
2024-05-21 19:10:17 +01:00
namespace SPT.SinglePlayer.Patches.MainMenu
2024-03-21 11:04:53 +00:00
{
public class AmmoUsedCounterPatch : ModulePatch
2024-03-21 11:04:53 +00:00
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(Player), nameof(Player.OnMakingShot));
2024-03-21 11:04:53 +00:00
}
[PatchPostfix]
public static void PatchPostfix(Player __instance)
2024-03-21 11:04:53 +00:00
{
if (__instance.IsYourPlayer)
{
__instance.Profile.EftStats.SessionCounters.AddLong(1L, SessionCounterTypesAbstractClass.AmmoUsed);
}
2024-03-21 11:04:53 +00:00
}
}
}