Skip to content

Commit

Permalink
Moved patches and fixed Scp173FirstKillPatch
Browse files Browse the repository at this point in the history
  • Loading branch information
skyfr0676 committed Aug 6, 2024
1 parent 866ce48 commit f7f5986
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.Events.Patches.Generic
namespace Exiled.Events.Patches.Fixes
{
using System.Collections.Generic;
using System.Reflection.Emit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.Events.Patches.Generic
namespace Exiled.Events.Patches.Fixes
{
using System.Collections.Generic;
using System.Reflection.Emit;
Expand Down Expand Up @@ -33,11 +33,11 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
int index = newInstructions.FindLastIndex(x => x.opcode == OpCodes.Ldc_I4_0);
newInstructions[index].WithLabels(continueLabel);

// TODO: NRE ON LEFT CLICK (KICK PLAYER) - DO NOT PUSH
newInstructions.InsertRange(index, new CodeInstruction[]
{
// if (hub.playerEffectController.GetEffect<SpawnProtected>().IsEnabled) return false;
new(OpCodes.Ldarg_1),
// if (hitboxIdentity.TargetHub.playerEffectController.GetEffect<SpawnProtected>().IsEnabled) return false;
new(OpCodes.Ldloc_2),
new(OpCodes.Callvirt, PropertyGetter(typeof(HitboxIdentity), nameof(HitboxIdentity.TargetHub))),
new(OpCodes.Ldfld, Field(typeof(ReferenceHub), nameof(ReferenceHub.playerEffectsController))),
new(OpCodes.Callvirt, Method(typeof(PlayerEffectsController), nameof(PlayerEffectsController.GetEffect), generics: new[] { typeof(SpawnProtected) })),
new(OpCodes.Callvirt, PropertyGetter(typeof(StatusEffectBase), nameof(StatusEffectBase.IsEnabled))),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.Events.Patches.Generic
namespace Exiled.Events.Patches.Fixes
{
using System.Collections.Generic;
using System.Reflection.Emit;
Expand Down

0 comments on commit f7f5986

Please sign in to comment.