mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 09:50:43 -05:00
25 lines
650 B
C#
25 lines
650 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]
|
|
private static void PatchPostfix(Player __instance)
|
|
{
|
|
if (__instance.IsYourPlayer)
|
|
{
|
|
__instance.Profile.EftStats.SessionCounters.AddLong(1L, SessionCounterTypesAbstractClass.AmmoUsed);
|
|
}
|
|
}
|
|
}
|
|
}
|