From 68f312834ac68aef6cd6ee013cd9734ff6eee2fb Mon Sep 17 00:00:00 2001 From: kalane15 <118661099+kalane15@users.noreply.github.com> Date: Tue, 15 Aug 2023 08:07:54 +0300 Subject: [PATCH] bug with reflection fixed (#19127) * bug with reflection fixed * check for pockets added --- Content.Shared/Weapons/Reflect/SharedReflectSystem.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Content.Shared/Weapons/Reflect/SharedReflectSystem.cs b/Content.Shared/Weapons/Reflect/SharedReflectSystem.cs index 80ee7b97b1..1a5e00d6ce 100644 --- a/Content.Shared/Weapons/Reflect/SharedReflectSystem.cs +++ b/Content.Shared/Weapons/Reflect/SharedReflectSystem.cs @@ -174,8 +174,10 @@ public abstract class SharedReflectSystem : EntitySystem if (!TryComp(args.Equipee, out ReflectComponent? reflection)) return; - reflection.Enabled = true; + if (args.Slot == "pocket1" || args.Slot == "pocket2") + return; + reflection.Enabled = comp.Enabled; // reflection probability should be: (1 - old probability) * newly-equipped item probability + old probability // example: if entity has .25 reflection and newly-equipped item has .7, entity should have (1 - .25) * .7 + .25 = .775 reflection.ReflectProb += (1 - reflection.ReflectProb) * comp.ReflectProb;