Skip to content
This repository was archived by the owner on Jul 8, 2025. It is now read-only.
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions EXILED/Exiled.Events/Patches/Events/Scp173/BeingObserved.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,20 @@

namespace Exiled.Events.Patches.Events.Scp173
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;

using API.Features;

using Exiled.API.Features.Pools;
using Exiled.Events.Attributes;
using Exiled.Events.EventArgs.Scp173;
using HarmonyLib;

using PlayerRoles.PlayableScps;
using PlayerRoles.PlayableScps.Scp173;
using PlayerRoles.Subroutines;

Expand All @@ -35,13 +40,12 @@

Label continueLabel = generator.DefineLabel();

int offset = 1;
int index = newInstructions.FindIndex(x => x.opcode == OpCodes.Brtrue_S) + offset;

int offset = 4;
int index = newInstructions.FindIndex(x =>x.Calls(PropertyGetter(typeof(VisionInformation), nameof(VisionInformation.IsLooking)))) + offset;

Check failure on line 44 in EXILED/Exiled.Events/Patches/Events/Scp173/BeingObserved.cs

View workflow job for this annotation

GitHub Actions / build

newInstructions.InsertRange(index, new CodeInstruction[]
{
// Player.Get(target)
new(OpCodes.Ldarg_1),
new CodeInstruction(OpCodes.Ldarg_1).MoveLabelsFrom(newInstructions[index]),
new(OpCodes.Call, Method(typeof(API.Features.Player), nameof(API.Features.Player.Get), new[] { typeof(ReferenceHub) })),

// Player.Get(base.Owner)
Expand Down
Loading