From 447f866745502b133f4b71a065c65d6992495681 Mon Sep 17 00:00:00 2001 From: Tayrtahn Date: Wed, 28 May 2025 12:17:43 -0400 Subject: [PATCH] Cleanup warning in `StealConditionSystem` (#37903) Fix 1 warning in StealConditionSystem --- .../Objectives/Systems/StealConditionSystem.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Content.Server/Objectives/Systems/StealConditionSystem.cs b/Content.Server/Objectives/Systems/StealConditionSystem.cs index 7dc628c46f..44a91017ee 100644 --- a/Content.Server/Objectives/Systems/StealConditionSystem.cs +++ b/Content.Server/Objectives/Systems/StealConditionSystem.cs @@ -79,7 +79,7 @@ public sealed class StealConditionSystem : EntitySystem var group = _proto.Index(condition.Comp.StealGroup); string localizedName = Loc.GetString(group.Name); - var title =condition.Comp.OwnerText == null + var title = condition.Comp.OwnerText == null ? Loc.GetString(condition.Comp.ObjectiveNoOwnerText, ("itemName", localizedName)) : Loc.GetString(condition.Comp.ObjectiveText, ("owner", Loc.GetString(condition.Comp.OwnerText)), ("itemName", localizedName)); @@ -93,12 +93,12 @@ public sealed class StealConditionSystem : EntitySystem } private void OnGetProgress(Entity condition, ref ObjectiveGetProgressEvent args) { - args.Progress = GetProgress(args.Mind, condition); + args.Progress = GetProgress((args.MindId, args.Mind), condition); } - private float GetProgress(MindComponent mind, StealConditionComponent condition) + private float GetProgress(Entity mind, StealConditionComponent condition) { - if (!_containerQuery.TryGetComponent(mind.OwnedEntity, out var currentManager)) + if (!_containerQuery.TryGetComponent(mind.Comp.OwnedEntity, out var currentManager)) return 0; var containerStack = new Stack(); @@ -128,7 +128,7 @@ public sealed class StealConditionSystem : EntitySystem } //check pulling object - if (TryComp(mind.OwnedEntity, out var pull)) //TO DO: to make the code prettier? don't like the repetition + if (TryComp(mind.Comp.OwnedEntity, out var pull)) //TO DO: to make the code prettier? don't like the repetition { var pulledEntity = pull.Pulling; if (pulledEntity != null) @@ -155,7 +155,7 @@ public sealed class StealConditionSystem : EntitySystem } } while (containerStack.TryPop(out currentManager)); - var result = count / (float) condition.CollectionSize; + var result = count / (float)condition.CollectionSize; result = Math.Clamp(result, 0, 1); return result; } -- 2.51.2