Skip to content

Commit b0ac8bb

Browse files
authored
Nuke Dev Bug reporting (SubnauticaNitrox#1094)
* Create SentrySdk_Start_Patch.cs * Update NitroxPatcher.csproj
1 parent 66b21b9 commit b0ac8bb

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

NitroxPatcher/NitroxPatcher.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@
226226
<Link>Properties\AssemblyInfoCommon.cs</Link>
227227
</Compile>
228228
<Compile Include="Main.cs" />
229+
<Compile Include="Patches\Persistent\SentrySdk_Start_Patch.cs" />
229230
<Compile Include="Modules\NitroxPatchesModule.cs" />
230231
<Compile Include="Patches\Dynamic\KeypadDoorConsole_AcceptNumberField_Patch.cs" />
231232
<Compile Include="Patches\Dynamic\Player_OnKill_Patch.cs" />
@@ -390,4 +391,4 @@
390391
<Target Name="AfterBuild">
391392
</Target>
392393
-->
393-
</Project>
394+
</Project>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
using System.Reflection;
3+
using Harmony;
4+
using NitroxClient.MonoBehaviours;
5+
6+
namespace NitroxPatcher.Patches.Persistent
7+
{
8+
internal class SentrySdk_Start_Patch : NitroxPatch, IPersistentPatch
9+
{
10+
public static readonly Type TARGET_CLASS = typeof(SentrySdk);
11+
public static readonly MethodInfo TARGET_METHOD = TARGET_CLASS.GetMethod("Start", BindingFlags.Public | BindingFlags.Instance);
12+
13+
public static bool Prefix(SentrySdk __instance)
14+
{
15+
UnityEngine.Object.Destroy(__instance);
16+
return false;
17+
}
18+
19+
public override void Patch(HarmonyInstance harmony)
20+
{
21+
PatchPrefix(harmony, TARGET_METHOD);
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)