From 0417ab315709dd11ea19689c38d0f4b108823a65 Mon Sep 17 00:00:00 2001 From: MS-crew <100300664+MS-crew@users.noreply.github.com> Date: Mon, 5 Jan 2026 15:11:46 +0300 Subject: [PATCH 1/2] Update Config.cs --- EXILED/Exiled.Events/Config.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/EXILED/Exiled.Events/Config.cs b/EXILED/Exiled.Events/Config.cs index fd244f699b..8f90d158b0 100644 --- a/EXILED/Exiled.Events/Config.cs +++ b/EXILED/Exiled.Events/Config.cs @@ -50,6 +50,12 @@ public sealed class Config : IConfig [Description("Indicates whether tutorial is affected by SCP-079 scan.")] public bool TutorialNotAffectedByScp079Scan { get; set; } = false; + /// + /// Gets or sets a value indicating whether the last human glowing effect is enabled. + /// + [Description("Indicates whether the last human glowing effect is enabled")] + public bool CanLastHumanGlow { get; set; } = true; + /// /// Gets or sets a value indicating whether flashbangs flash original thrower. /// From 3d5e59e43b14c0cc2375f8b715bdf232d50805d9 Mon Sep 17 00:00:00 2001 From: MS-crew <100300664+MS-crew@users.noreply.github.com> Date: Mon, 5 Jan 2026 15:12:19 +0300 Subject: [PATCH 2/2] Create LastTargetGlowing.cs --- .../Patches/Generic/LastTargetGlowing.cs | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 EXILED/Exiled.Events/Patches/Generic/LastTargetGlowing.cs diff --git a/EXILED/Exiled.Events/Patches/Generic/LastTargetGlowing.cs b/EXILED/Exiled.Events/Patches/Generic/LastTargetGlowing.cs new file mode 100644 index 0000000000..d0fda20563 --- /dev/null +++ b/EXILED/Exiled.Events/Patches/Generic/LastTargetGlowing.cs @@ -0,0 +1,64 @@ +// ----------------------------------------------------------------------- +// +// Copyright (c) ExMod Team. All rights reserved. +// Licensed under the CC BY-SA 3.0 license. +// +// ----------------------------------------------------------------------- + +namespace Exiled.Events.Patches.Generic +{ + using System.Collections.Generic; + using System.Reflection.Emit; + + using Exiled.API.Features; + using Exiled.API.Features.Pools; + + using HarmonyLib; + + using PlayerRoles.PlayableScps.HumanTracker; + + using UnityEngine; + + using static HarmonyLib.AccessTools; + + using ExiledEvents = Exiled.Events.Events; + + /// + /// Patches setter to implement . + /// + [HarmonyPatch(typeof(LastHumanTracker), nameof(LastHumanTracker.Network_lastTargetPos), MethodType.Setter)] + public class LastTargetGlowing + { + private static readonly Vector3? FakePosition = new(999f, 999f, 999f); + + private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) + { + List newInstructions = ListPool.Pool.Get(instructions); + + Label continueLabel = generator.DefineLabel(); + + newInstructions[0].labels.Add(continueLabel); + + newInstructions.InsertRange( + 0, + new CodeInstruction[] + { + // if (!ExiledEvents.Instance.Config.LastHumanGlowing) + // goto continueLabel; + new(OpCodes.Call, PropertyGetter(typeof(ExiledEvents), nameof(ExiledEvents.Instance))), + new(OpCodes.Callvirt, PropertyGetter(typeof(Plugin), nameof(Plugin.Config))), + new(OpCodes.Callvirt, PropertyGetter(typeof(Config), nameof(Config.CanLastHumanGlow))), + new(OpCodes.Brtrue_S, continueLabel), + + // value = FakeVector; + new(OpCodes.Ldsfld, AccessTools.Field(typeof(LastTargetGlowing), nameof(FakePosition))), + new(OpCodes.Starg_S, 1), + }); + + for (int z = 0; z < newInstructions.Count; ++z) + yield return newInstructions[z]; + + ListPool.Pool.Return(newInstructions); + } + } +}