From: ReeZer2 <63300653+ReeZer2@users.noreply.github.com> Date: Wed, 1 Jan 2025 16:25:48 +0000 (+0200) Subject: FIX: Thief beacon doubled steal targets (#33750) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=4f2d60989084a2356286f1a0336339467790b351;p=space-station-14.git FIX: Thief beacon doubled steal targets (#33750) --- diff --git a/Content.Server/Objectives/Systems/StealConditionSystem.cs b/Content.Server/Objectives/Systems/StealConditionSystem.cs index 48814e7ba3..d61b796e42 100644 --- a/Content.Server/Objectives/Systems/StealConditionSystem.cs +++ b/Content.Server/Objectives/Systems/StealConditionSystem.cs @@ -29,6 +29,7 @@ public sealed class StealConditionSystem : EntitySystem private EntityQuery _containerQuery; private HashSet> _nearestEnts = new(); + private HashSet _countedItems = new(); public override void Initialize() { @@ -104,6 +105,8 @@ public sealed class StealConditionSystem : EntitySystem var containerStack = new Stack(); var count = 0; + _countedItems.Clear(); + //check stealAreas if (condition.CheckStealAreas) { @@ -174,6 +177,9 @@ public sealed class StealConditionSystem : EntitySystem private int CheckStealTarget(EntityUid entity, StealConditionComponent condition) { + if (_countedItems.Contains(entity)) + return 0; + // check if this is the target if (!TryComp(entity, out var target)) return 0; @@ -196,6 +202,8 @@ public sealed class StealConditionSystem : EntitySystem } } + _countedItems.Add(entity); + return TryComp(entity, out var stack) ? stack.Count : 1; } }