mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 08:30:45 -05:00
31 lines
1.1 KiB
C#
31 lines
1.1 KiB
C#
using SPT.Reflection.Patching;
|
|
using Comfort.Common;
|
|
using EFT;
|
|
using EFT.UI;
|
|
using System.Reflection;
|
|
using HarmonyLib;
|
|
|
|
namespace SPT.Custom.Patches
|
|
{
|
|
public class RankPanelPatch : ModulePatch
|
|
{
|
|
protected override MethodBase GetTargetMethod()
|
|
{
|
|
return AccessTools.Method(typeof(RankPanel), nameof(RankPanel.Show));
|
|
}
|
|
|
|
[PatchPrefix]
|
|
private static bool PatchPreFix(ref int rankLevel, ref int maxRank)
|
|
{
|
|
if (Singleton<GameWorld>.Instance != null)
|
|
{
|
|
Logger.LogWarning("Rank Level: " + rankLevel.ToString() + " Max Rank Level: " + maxRank.ToString());
|
|
ConsoleScreen.LogError("Rank Level: " + rankLevel.ToString() + " Max Rank Level: " + maxRank.ToString());
|
|
ConsoleScreen.LogError("Game Broke!");
|
|
Logger.LogWarning("This Shouldn't happen!! Please report this in discord");
|
|
ConsoleScreen.LogError("This Shouldn't happen!! Please report this in discord");
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
} |