From 115f8e68c8681964b0f3f0e5beff41883bd3ae31 Mon Sep 17 00:00:00 2001 From: ReeZer2 <63300653+ReeZer2@users.noreply.github.com> Date: Wed, 1 Jan 2025 18:25:48 +0200 Subject: [PATCH] FIX: Thief beacon doubled steal targets (#33750) --- Content.Server/Objectives/Systems/StealConditionSystem.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Content.Server/Objectives/Systems/StealConditionSystem.cs b/Content.Server/Objectives/Systems/StealConditionSystem.cs index 0607b4b3ca..497d6d14ef 100644 --- a/Content.Server/Objectives/Systems/StealConditionSystem.cs +++ b/Content.Server/Objectives/Systems/StealConditionSystem.cs @@ -28,6 +28,7 @@ public sealed class StealConditionSystem : EntitySystem private EntityQuery _containerQuery; private HashSet> _nearestEnts = new(); + private HashSet _countedItems = new(); public override void Initialize() { @@ -103,6 +104,8 @@ public sealed class StealConditionSystem : EntitySystem var containerStack = new Stack(); var count = 0; + _countedItems.Clear(); + //check stealAreas if (condition.CheckStealAreas) { @@ -173,6 +176,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; @@ -190,6 +196,8 @@ public sealed class StealConditionSystem : EntitySystem } } + _countedItems.Add(entity); + return TryComp(entity, out var stack) ? stack.Count : 1; } }