Skip to content

Commit 1b2e431

Browse files
committed
Revert targetMethod changes
1 parent eba67c7 commit 1b2e431

File tree

214 files changed

+326
-346
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

214 files changed

+326
-346
lines changed

NitroxPatcher/Patches/Dynamic/ArmsController_Start_Patch.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
using System.Reflection;
1+
using System.Reflection;
22
using NitroxModel.Helper;
33

44
namespace NitroxPatcher.Patches.Dynamic;
55

66
public sealed partial class ArmsController_Start_Patch : NitroxPatch, IDynamicPatch
77
{
8-
public override MethodInfo targetMethod { get; } = Reflect.Method((ArmsController t) => t.Start());
8+
public static readonly MethodInfo TARGET_METHOD = Reflect.Method((ArmsController t) => t.Start());
99

1010
public static void Postfix(ArmsController __instance)
1111
{

NitroxPatcher/Patches/Dynamic/ArmsController_Update_Patch.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
using System.Reflection;
1+
using System.Reflection;
22
using NitroxModel.Helper;
33

44
namespace NitroxPatcher.Patches.Dynamic;
55

66
public sealed partial class ArmsController_Update_Patch : NitroxPatch, IDynamicPatch
77
{
8-
public override MethodInfo targetMethod { get; } = Reflect.Method((ArmsController t) => t.Update());
8+
public static readonly MethodInfo TARGET_METHOD = Reflect.Method((ArmsController t) => t.Update());
99

1010
public static bool Prefix(ArmsController __instance)
1111
{

NitroxPatcher/Patches/Dynamic/BaseDeconstructable_Deconstruct_Patch.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace NitroxPatcher.Patches.Dynamic;
1919

2020
public sealed partial class BaseDeconstructable_Deconstruct_Patch : NitroxPatch, IDynamicPatch
2121
{
22-
public override MethodInfo targetMethod { get; } = Reflect.Method((BaseDeconstructable t) => t.Deconstruct());
22+
public static readonly MethodInfo TARGET_METHOD = Reflect.Method((BaseDeconstructable t) => t.Deconstruct());
2323

2424
private static TemporaryBuildData Temp => BuildingHandler.Main.Temp;
2525
private static BuildPieceIdentifier cachedPieceIdentifier;

NitroxPatcher/Patches/Dynamic/BaseDeconstructable_DeconstructionAllowed_Patch.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace NitroxPatcher.Patches.Dynamic;
77

88
public sealed partial class BaseDeconstructable_DeconstructionAllowed_Patch : NitroxPatch, IDynamicPatch
99
{
10-
public override MethodInfo targetMethod { get; } = Reflect.Method((BaseDeconstructable t) => t.DeconstructionAllowed(out Reflect.Ref<string>.Field));
10+
public static readonly MethodInfo TARGET_METHOD = Reflect.Method((BaseDeconstructable t) => t.DeconstructionAllowed(out Reflect.Ref<string>.Field));
1111

1212
public static void Postfix(BaseDeconstructable __instance, ref bool __result, ref string reason)
1313
{

NitroxPatcher/Patches/Dynamic/Base_OnPreDestroy_Patch.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace NitroxPatcher.Patches.Dynamic;
99
/// </summary>
1010
public sealed partial class Base_OnPreDestroy_Patch : NitroxPatch, IDynamicPatch
1111
{
12-
public override MethodInfo targetMethod { get; } = Reflect.Method((Base t) => t.OnPreDestroy());
12+
public static readonly MethodInfo TARGET_METHOD = Reflect.Method((Base t) => t.OnPreDestroy());
1313

1414
public static void Prefix(Base __instance)
1515
{

NitroxPatcher/Patches/Dynamic/Bed_EnterInUseMode_Patch.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Reflection;
1+
using System.Reflection;
22
using NitroxClient.Communication.Abstract;
33
using NitroxModel.Core;
44
using NitroxModel.Helper;
@@ -8,7 +8,7 @@ namespace NitroxPatcher.Patches.Dynamic;
88

99
public sealed partial class Bed_EnterInUseMode_Patch : NitroxPatch, IDynamicPatch
1010
{
11-
public override MethodInfo targetMethod { get; } = Reflect.Method((Bed t) => t.EnterInUseMode(default(Player)));
11+
public static readonly MethodInfo TARGET_METHOD = Reflect.Method((Bed t) => t.EnterInUseMode(default(Player)));
1212

1313
public static void Postfix()
1414
{

NitroxPatcher/Patches/Dynamic/Bench_ExitSittingMode_Patch.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Collections;
1+
using System.Collections;
22
using System.Reflection;
33
using NitroxClient.GameLogic;
44
using NitroxClient.GameLogic.ChatUI;
@@ -11,7 +11,7 @@ namespace NitroxPatcher.Patches.Dynamic;
1111

1212
public sealed partial class Bench_ExitSittingMode_Patch : NitroxPatch, IDynamicPatch
1313
{
14-
public override MethodInfo targetMethod { get; } = Reflect.Method((Bench t) => t.ExitSittingMode(default, default));
14+
private static readonly MethodInfo TARGET_METHOD = Reflect.Method((Bench t) => t.ExitSittingMode(default, default));
1515

1616
public static void Prefix(ref bool __runOriginal)
1717
{

NitroxPatcher/Patches/Dynamic/Bench_OnHandClick_Patch.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Reflection;
1+
using System.Reflection;
22
using NitroxClient.GameLogic;
33
using NitroxClient.GameLogic.HUD.Components;
44
using NitroxClient.GameLogic.Simulation;
@@ -10,7 +10,7 @@ namespace NitroxPatcher.Patches.Dynamic;
1010

1111
public sealed partial class Bench_OnHandClick_Patch : NitroxPatch, IDynamicPatch
1212
{
13-
public override MethodInfo targetMethod { get; } = Reflect.Method((Bench t) => t.OnHandClick(default(GUIHand)));
13+
private static readonly MethodInfo TARGET_METHOD = Reflect.Method((Bench t) => t.OnHandClick(default(GUIHand)));
1414
private static bool skipPrefix;
1515

1616
public static bool Prefix(Bench __instance, GUIHand hand)

NitroxPatcher/Patches/Dynamic/Bench_OnPlayerDeath_Patch.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Reflection;
1+
using System.Reflection;
22
using NitroxClient.GameLogic;
33
using NitroxClient.MonoBehaviours;
44
using NitroxModel.DataStructures;
@@ -8,7 +8,7 @@ namespace NitroxPatcher.Patches.Dynamic;
88

99
public sealed partial class Bench_OnPlayerDeath_Patch : NitroxPatch, IDynamicPatch
1010
{
11-
public override MethodInfo targetMethod { get; } = Reflect.Method((Bench t) => t.OnPlayerDeath(default(Player)));
11+
private static readonly MethodInfo TARGET_METHOD = Reflect.Method((Bench t) => t.OnPlayerDeath(default(Player)));
1212

1313
public static void Postfix(Bench __instance)
1414
{

NitroxPatcher/Patches/Dynamic/BreakableResource_BreakIntoResources_Patch.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace NitroxPatcher.Patches.Dynamic;
88

99
public sealed partial class BreakableResource_BreakIntoResources_Patch : NitroxPatch, IDynamicPatch
1010
{
11-
public override MethodInfo targetMethod { get; } = Reflect.Method((BreakableResource t) => t.BreakIntoResources());
11+
private static MethodInfo TARGET_METHOD = Reflect.Method((BreakableResource t) => t.BreakIntoResources());
1212

1313
public static void Prefix(BreakableResource __instance)
1414
{

NitroxPatcher/Patches/Dynamic/BreakableResource_SpawnResourceFromPrefab_Patch.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace NitroxPatcher.Patches.Dynamic;
1616
/// </summary>
1717
public sealed partial class BreakableResource_SpawnResourceFromPrefab_Patch : NitroxPatch, IDynamicPatch
1818
{
19-
public override MethodInfo targetMethod { get; } = AccessTools.EnumeratorMoveNext(Reflect.Method(() => BreakableResource.SpawnResourceFromPrefab(default, default, default)));
19+
public static readonly MethodInfo TARGET_METHOD = AccessTools.EnumeratorMoveNext(Reflect.Method(() => BreakableResource.SpawnResourceFromPrefab(default, default, default)));
2020

2121
private static readonly InstructionsPattern SpawnResFromPrefPattern = new()
2222
{

NitroxPatcher/Patches/Dynamic/BuilderTool_Construct_Patch.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace NitroxPatcher.Patches.Dynamic;
88

99
public sealed partial class BuilderTool_Construct_Patch : NitroxPatch, IDynamicPatch
1010
{
11-
public override MethodInfo targetMethod { get; } = Reflect.Method((BuilderTool t) => t.Construct(default, default, default));
11+
public static readonly MethodInfo TARGET_METHOD = Reflect.Method((BuilderTool t) => t.Construct(default, default, default));
1212

1313
public static bool Prefix(Constructable c)
1414
{

NitroxPatcher/Patches/Dynamic/Builder_TryPlace_Patch.cs

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System;
21
using System.Collections.Generic;
32
using System.Reflection;
43
using HarmonyLib;
@@ -18,7 +17,7 @@ namespace NitroxPatcher.Patches.Dynamic;
1817

1918
public sealed partial class Builder_TryPlace_Patch : NitroxPatch, IDynamicPatch
2019
{
21-
public override MethodInfo targetMethod { get; } = Reflect.Method(() => Builder.TryPlace());
20+
public static readonly MethodInfo TARGET_METHOD = Reflect.Method(() => Builder.TryPlace());
2221

2322
public static readonly InstructionsPattern AddInstructionPattern1 = new()
2423
{
@@ -44,16 +43,11 @@ public sealed partial class Builder_TryPlace_Patch : NitroxPatch, IDynamicPatch
4443
{ new() { OpCode = Callvirt, Operand = new(nameof(Constructable), nameof(Constructable.SetIsInside)) }, "Insert2" }
4544
};
4645

47-
public static List<CodeInstruction> InstructionsToAdd2;
48-
49-
public Builder_TryPlace_Patch()
46+
public static readonly List<CodeInstruction> InstructionsToAdd2 = new()
5047
{
51-
InstructionsToAdd2 = new()
52-
{
53-
targetMethod.Ldloc<Constructable>(),
54-
new(Call, Reflect.Method(() => GhostCreated(default)))
55-
};
56-
}
48+
TARGET_METHOD.Ldloc<Constructable>(),
49+
new(Call, Reflect.Method(() => GhostCreated(default)))
50+
};
5751

5852
public static IEnumerable<CodeInstruction> Transpiler(MethodBase original, IEnumerable<CodeInstruction> instructions) =>
5953
instructions.Transform(AddInstructionPattern1, (label, instruction) =>

NitroxPatcher/Patches/Dynamic/Builder_Update_Patch.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace NitroxPatcher.Patches.Dynamic;
1313
/// </summary>
1414
public sealed partial class Builder_Update_Patch : NitroxPatch, IDynamicPatch
1515
{
16-
public override MethodInfo targetMethod { get; } = Reflect.Method(() => Builder.Update());
16+
public static readonly MethodInfo TARGET_METHOD = Reflect.Method(() => Builder.Update());
1717
private static readonly Color DESYNCED_COLOR = Color.magenta;
1818

1919
public static void Postfix()

NitroxPatcher/Patches/Dynamic/ConstructableBase_SetState_Patch.cs

+5-10
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace NitroxPatcher.Patches.Dynamic;
1313

1414
public sealed partial class ConstructableBase_SetState_Patch : NitroxPatch, IDynamicPatch
1515
{
16-
public override MethodInfo targetMethod { get; } = Reflect.Method((ConstructableBase t) => t.SetState(default, default));
16+
public static readonly MethodInfo TARGET_METHOD = Reflect.Method((ConstructableBase t) => t.SetState(default, default));
1717

1818
/*
1919
* Make it become
@@ -29,16 +29,11 @@ public sealed partial class ConstructableBase_SetState_Patch : NitroxPatch, IDyn
2929
{ Brfalse, "Insert" }
3030
};
3131

32-
public static List<CodeInstruction> InstructionsToAdd;
33-
public ConstructableBase_SetState_Patch()
32+
public static readonly List<CodeInstruction> InstructionsToAdd = new()
3433
{
35-
InstructionsToAdd = new()
36-
{
37-
targetMethod.Ldloc<GameObject>(),
38-
new(Call, Reflect.Method(() => BeforeDestroy(default)))
39-
};
40-
41-
}
34+
TARGET_METHOD.Ldloc<GameObject>(),
35+
new(Call, Reflect.Method(() => BeforeDestroy(default)))
36+
};
4237

4338
public static IEnumerable<CodeInstruction> Transpiler(MethodBase original, IEnumerable<CodeInstruction> instructions) =>
4439
instructions.Transform(InstructionPattern, (label, instruction) =>

NitroxPatcher/Patches/Dynamic/Constructable_Construct_Patch.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace NitroxPatcher.Patches.Dynamic;
2525

2626
public sealed partial class Constructable_Construct_Patch : NitroxPatch, IDynamicPatch
2727
{
28-
public override MethodInfo targetMethod { get; } = Reflect.Method((Constructable t) => t.Construct());
28+
public static readonly MethodInfo TARGET_METHOD = Reflect.Method((Constructable t) => t.Construct());
2929

3030
private static TemporaryBuildData Temp => BuildingHandler.Main.Temp;
3131

NitroxPatcher/Patches/Dynamic/Constructable_DeconstructAsync_Patch.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace NitroxPatcher.Patches.Dynamic;
99

1010
public sealed partial class Constructable_DeconstructAsync_Patch : NitroxPatch, IDynamicPatch
1111
{
12-
public override MethodInfo targetMethod { get; } = AccessTools.EnumeratorMoveNext(Reflect.Method((Constructable t) => t.DeconstructAsync(default, default)));
12+
public static readonly MethodInfo TARGET_METHOD = AccessTools.EnumeratorMoveNext(Reflect.Method((Constructable t) => t.DeconstructAsync(default, default)));
1313

1414
public static readonly InstructionsPattern InstructionsPattern = new()
1515
{

NitroxPatcher/Patches/Dynamic/Constructable_DeconstructionAllowed_Patch.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace NitroxPatcher.Patches.Dynamic;
1313
/// </summary>
1414
public sealed partial class Constructable_DeconstructionAllowed_Patch : NitroxPatch, IDynamicPatch
1515
{
16-
public override MethodInfo targetMethod { get; } = Reflect.Method((Constructable t) => t.DeconstructionAllowed(out Reflect.Ref<string>.Field));
16+
public static readonly MethodInfo TARGET_METHOD = Reflect.Method((Constructable t) => t.DeconstructionAllowed(out Reflect.Ref<string>.Field));
1717

1818
public static void Postfix(Constructable __instance, ref bool __result, ref string reason)
1919
{

NitroxPatcher/Patches/Dynamic/ConstructorInput_OnCraftingBegin_Patch.cs

+3-4
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ namespace NitroxPatcher.Patches.Dynamic
1111
{
1212
public sealed partial class ConstructorInput_OnCraftingBegin_Patch : NitroxPatch, IDynamicPatch
1313
{
14-
private static readonly Type TARGET_TYPE = typeof(ConstructorInput);
15-
public override MethodInfo targetMethod { get; } = AccessTools.EnumeratorMoveNext(Reflect.Method((ConstructorInput t) => t.OnCraftingBeginAsync(default(TechType), default(float))));
14+
public static readonly MethodInfo TARGET_METHOD = AccessTools.EnumeratorMoveNext(Reflect.Method((ConstructorInput t) => t.OnCraftingBeginAsync(default(TechType), default(float))));
1615

1716
public static readonly OpCode INJECTION_OPCODE = OpCodes.Call;
1817
public static readonly object INJECTION_OPERAND = Reflect.Method(() => CrafterLogic.NotifyCraftEnd(default(GameObject), default(TechType)));
@@ -33,9 +32,9 @@ public static IEnumerable<CodeInstruction> Transpiler(MethodBase original, IEnum
3332
yield return original.Ldloc<ConstructorInput>(0);
3433
yield return original.Ldloc<GameObject>(0);
3534
yield return new CodeInstruction(OpCodes.Ldarg_0);
36-
yield return new CodeInstruction(OpCodes.Ldfld, TARGET_TYPE.GetField("techType", BindingFlags.Instance | BindingFlags.Public));
35+
yield return new CodeInstruction(OpCodes.Ldfld, TARGET_METHOD.DeclaringType.GetField("techType", BindingFlags.Instance | BindingFlags.Public));
3736
yield return new CodeInstruction(OpCodes.Ldarg_0);
38-
yield return new CodeInstruction(OpCodes.Ldfld, TARGET_TYPE.GetField("duration", BindingFlags.Instance | BindingFlags.Public));
37+
yield return new CodeInstruction(OpCodes.Ldfld, TARGET_METHOD.DeclaringType.GetField("duration", BindingFlags.Instance | BindingFlags.Public));
3938
yield return new CodeInstruction(OpCodes.Call, ((Action<ConstructorInput, GameObject, TechType, float>)Callback).Method);
4039
}
4140
}

NitroxPatcher/Patches/Dynamic/Constructor_Deploy_Patch.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace NitroxPatcher.Patches.Dynamic;
77

88
public sealed partial class Constructor_Deploy_Patch : NitroxPatch, IDynamicPatch
99
{
10-
public override MethodInfo targetMethod { get; } = Reflect.Method((Constructor t) => t.Deploy(default(bool)));
10+
public static readonly MethodInfo TARGET_METHOD = Reflect.Method((Constructor t) => t.Deploy(default(bool)));
1111

1212
public static void Prefix(Constructor __instance, bool value)
1313
{

NitroxPatcher/Patches/Dynamic/CrafterLogic_TryPickupSingleAsync_Patch.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace NitroxPatcher.Patches.Dynamic;
1717
*/
1818
public sealed partial class CrafterLogic_TryPickupSingleAsync_Patch : NitroxPatch, IDynamicPatch
1919
{
20-
public override MethodInfo targetMethod { get; } = AccessTools.EnumeratorMoveNext(Reflect.Method((CrafterLogic t) => t.TryPickupSingleAsync(default(TechType), default(IOut<bool>))));
20+
public static readonly MethodInfo TARGET_METHOD = AccessTools.EnumeratorMoveNext(Reflect.Method((CrafterLogic t) => t.TryPickupSingleAsync(default(TechType), default(IOut<bool>))));
2121

2222
public static readonly OpCode INJECTION_OPCODE = OpCodes.Call;
2323
public static readonly object INJECTION_OPERAND = Reflect.Method(() => CrafterLogic.NotifyCraftEnd(default(GameObject), default(TechType)));

NitroxPatcher/Patches/Dynamic/CrashHome_Spawn_Patch.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
using System.Reflection;
1+
using System.Reflection;
22
using NitroxModel.Helper;
33

44
namespace NitroxPatcher.Patches.Dynamic;
55

66
public sealed partial class CrashHome_Spawn_Patch : NitroxPatch, IDynamicPatch
77
{
8-
public override MethodInfo targetMethod { get; } = Reflect.Method((CrashHome t) => t.Spawn());
8+
public static readonly MethodInfo TARGET_METHOD = Reflect.Method((CrashHome t) => t.Spawn());
99

1010
public static bool Prefix() // Disables Crashfish automatic spawning on the client
1111
{

NitroxPatcher/Patches/Dynamic/Creature_ChooseBestAction_Patch.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Reflection;
1+
using System.Reflection;
22
using NitroxClient.GameLogic;
33
using NitroxClient.Unity.Helper;
44
using NitroxModel.DataStructures;
@@ -8,7 +8,7 @@ namespace NitroxPatcher.Patches.Dynamic;
88

99
public sealed partial class Creature_ChooseBestAction_Patch : NitroxPatch, IDynamicPatch
1010
{
11-
public override MethodInfo targetMethod { get; } = Reflect.Method((Creature t) => t.ChooseBestAction(default(float)));
11+
public static readonly MethodInfo TARGET_METHOD = Reflect.Method((Creature t) => t.ChooseBestAction(default(float)));
1212

1313
private static CreatureAction previousAction;
1414

NitroxPatcher/Patches/Dynamic/CyclopsDamagePoint_OnRepair_Patch.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Reflection;
1+
using System.Reflection;
22
using NitroxClient.GameLogic;
33
using NitroxModel.Helper;
44

@@ -10,7 +10,7 @@ namespace NitroxPatcher.Patches.Dynamic;
1010
/// </summary>
1111
public sealed partial class CyclopsDamagePoint_OnRepair_Patch : NitroxPatch, IDynamicPatch
1212
{
13-
public override MethodInfo targetMethod { get; } = Reflect.Method((CyclopsDamagePoint t) => t.OnRepair());
13+
public static readonly MethodInfo TARGET_METHOD = Reflect.Method((CyclopsDamagePoint t) => t.OnRepair());
1414

1515
public static void Postfix(CyclopsDamagePoint __instance)
1616
{

NitroxPatcher/Patches/Dynamic/CyclopsDecoyLaunchButton_OnClick_Patch.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Reflection;
1+
using System.Reflection;
22
using NitroxClient.GameLogic;
33
using NitroxModel.Core;
44
using NitroxModel.DataStructures;
@@ -8,7 +8,7 @@ namespace NitroxPatcher.Patches.Dynamic;
88

99
public sealed partial class CyclopsDecoyLaunchButton_OnClick_Patch : NitroxPatch, IDynamicPatch
1010
{
11-
public override MethodInfo targetMethod { get; } = Reflect.Method((CyclopsDecoyLaunchButton t) => t.OnClick());
11+
public static readonly MethodInfo TARGET_METHOD = Reflect.Method((CyclopsDecoyLaunchButton t) => t.OnClick());
1212

1313
public static void Postfix(CyclopsHornButton __instance)
1414
{

NitroxPatcher/Patches/Dynamic/CyclopsDestructionEvent_DestroyCyclops_Patch.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Reflection;
1+
using System.Reflection;
22
using NitroxClient.GameLogic;
33
using NitroxClient.GameLogic.PlayerLogic;
44
using NitroxModel.DataStructures;
@@ -8,7 +8,7 @@ namespace NitroxPatcher.Patches.Dynamic;
88

99
public sealed partial class CyclopsDestructionEvent_DestroyCyclops_Patch : NitroxPatch, IDynamicPatch
1010
{
11-
public override MethodInfo targetMethod { get; } = Reflect.Method((CyclopsDestructionEvent t) => t.DestroyCyclops());
11+
private static readonly MethodInfo TARGET_METHOD = Reflect.Method((CyclopsDestructionEvent t) => t.DestroyCyclops());
1212

1313
public static void Prefix(CyclopsDestructionEvent __instance)
1414
{

NitroxPatcher/Patches/Dynamic/CyclopsEngineChangeState_OnClick_Patch.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace NitroxPatcher.Patches.Dynamic;
77

88
public sealed partial class CyclopsEngineChangeState_OnClick_Patch : NitroxPatch, IDynamicPatch
99
{
10-
public override MethodInfo targetMethod { get; } = Reflect.Method((CyclopsEngineChangeState t) => t.OnClick());
10+
public static readonly MethodInfo TARGET_METHOD = Reflect.Method((CyclopsEngineChangeState t) => t.OnClick());
1111

1212
public static void Postfix(CyclopsEngineChangeState __instance)
1313
{

NitroxPatcher/Patches/Dynamic/CyclopsExternalDamageManager_CreatePoint_Patch.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Reflection;
1+
using System.Reflection;
22
using NitroxClient.GameLogic;
33
using NitroxModel.DataStructures;
44
using NitroxModel.Helper;
@@ -7,7 +7,7 @@ namespace NitroxPatcher.Patches.Dynamic;
77

88
public sealed partial class CyclopsExternalDamageManager_CreatePoint_Patch : NitroxPatch, IDynamicPatch
99
{
10-
public override MethodInfo targetMethod { get; } = Reflect.Method((CyclopsExternalDamageManager t) => t.CreatePoint());
10+
public static readonly MethodInfo TARGET_METHOD = Reflect.Method((CyclopsExternalDamageManager t) => t.CreatePoint());
1111

1212
public static bool Prefix(CyclopsExternalDamageManager __instance, out bool __state)
1313
{

NitroxPatcher/Patches/Dynamic/CyclopsFireSuppressionButton_StartCooldown_Patch.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Reflection;
1+
using System.Reflection;
22
using NitroxClient.GameLogic;
33
using NitroxModel.Core;
44
using NitroxModel.DataStructures;
@@ -12,7 +12,7 @@ namespace NitroxPatcher.Patches.Dynamic;
1212
*/
1313
public sealed partial class CyclopsFireSuppressionButton_StartCooldown_Patch : NitroxPatch, IDynamicPatch
1414
{
15-
public override MethodInfo targetMethod { get; } = Reflect.Method((CyclopsFireSuppressionSystemButton t) => t.StartCooldown());
15+
public static readonly MethodInfo TARGET_METHOD = Reflect.Method((CyclopsFireSuppressionSystemButton t) => t.StartCooldown());
1616

1717
public static void Postfix(CyclopsFireSuppressionSystemButton __instance)
1818
{

0 commit comments

Comments
 (0)