From 79b770b7c79f7ca32623a35a5b6569dfaaeaaf9f Mon Sep 17 00:00:00 2001 From: Avery Dobbins Date: Mon, 29 Jul 2024 14:21:27 -0400 Subject: [PATCH 1/4] TryFindComponentsOnEntityContainerOrParent no fail please --- Robust.Shared/Containers/SharedContainerSystem.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Robust.Shared/Containers/SharedContainerSystem.cs b/Robust.Shared/Containers/SharedContainerSystem.cs index 88f9e0be181..5d4b9d72846 100644 --- a/Robust.Shared/Containers/SharedContainerSystem.cs +++ b/Robust.Shared/Containers/SharedContainerSystem.cs @@ -377,9 +377,12 @@ public bool TryFindComponentOnEntityContainerOrParent( if (!xform.ParentUid.Valid) return false; - if (entityQuery.Resolve(xform.ParentUid, ref foundComponent, false)) + if (entityQuery.TryComp(xform.ParentUid, out foundComponent)) return true; +// if (entityQuery.Resolve(xform.ParentUid, ref foundComponent, false)) +// return true; + return TryFindComponentOnEntityContainerOrParent(xform.ParentUid, entityQuery, ref foundComponent); } From 67b18e9ecdc2b998d6bd2fda8c17dad500f97b25 Mon Sep 17 00:00:00 2001 From: Avery Dobbins Date: Mon, 29 Jul 2024 14:25:36 -0400 Subject: [PATCH 2/4] remove my comments because Im dumb --- Robust.Shared/Containers/SharedContainerSystem.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/Robust.Shared/Containers/SharedContainerSystem.cs b/Robust.Shared/Containers/SharedContainerSystem.cs index 5d4b9d72846..bf70aef9611 100644 --- a/Robust.Shared/Containers/SharedContainerSystem.cs +++ b/Robust.Shared/Containers/SharedContainerSystem.cs @@ -380,9 +380,6 @@ public bool TryFindComponentOnEntityContainerOrParent( if (entityQuery.TryComp(xform.ParentUid, out foundComponent)) return true; -// if (entityQuery.Resolve(xform.ParentUid, ref foundComponent, false)) -// return true; - return TryFindComponentOnEntityContainerOrParent(xform.ParentUid, entityQuery, ref foundComponent); } From 54f4a6d50c47f22d5c2970c462e41ad7f0330fec Mon Sep 17 00:00:00 2001 From: Avery Dobbins Date: Wed, 7 Aug 2024 12:02:16 -0400 Subject: [PATCH 3/4] out makes sense to me! --- Robust.Shared/Containers/SharedContainerSystem.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Robust.Shared/Containers/SharedContainerSystem.cs b/Robust.Shared/Containers/SharedContainerSystem.cs index bf70aef9611..bafb711bace 100644 --- a/Robust.Shared/Containers/SharedContainerSystem.cs +++ b/Robust.Shared/Containers/SharedContainerSystem.cs @@ -361,10 +361,12 @@ public bool IsEntityOrParentInContainer( public bool TryFindComponentOnEntityContainerOrParent( EntityUid uid, EntityQuery entityQuery, - [NotNullWhen(true)] ref T? foundComponent, + [NotNullWhen(true)] out T? foundComponent, MetaDataComponent? meta = null, TransformComponent? xform = null) where T : IComponent { + foundComponent = default; + if (!MetaQuery.Resolve(uid, ref meta)) return false; @@ -380,7 +382,7 @@ public bool TryFindComponentOnEntityContainerOrParent( if (entityQuery.TryComp(xform.ParentUid, out foundComponent)) return true; - return TryFindComponentOnEntityContainerOrParent(xform.ParentUid, entityQuery, ref foundComponent); + return TryFindComponentOnEntityContainerOrParent(xform.ParentUid, entityQuery, out foundComponent); } /// From 0d2f48c180030c52413b1556a6796530db7fb3fb Mon Sep 17 00:00:00 2001 From: Avery Dobbins Date: Tue, 15 Oct 2024 14:25:12 -0400 Subject: [PATCH 4/4] Revert "out makes sense to me!" because PJB no want breaky This reverts commit 54f4a6d50c47f22d5c2970c462e41ad7f0330fec. --- Robust.Shared/Containers/SharedContainerSystem.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Robust.Shared/Containers/SharedContainerSystem.cs b/Robust.Shared/Containers/SharedContainerSystem.cs index bafb711bace..bf70aef9611 100644 --- a/Robust.Shared/Containers/SharedContainerSystem.cs +++ b/Robust.Shared/Containers/SharedContainerSystem.cs @@ -361,12 +361,10 @@ public bool IsEntityOrParentInContainer( public bool TryFindComponentOnEntityContainerOrParent( EntityUid uid, EntityQuery entityQuery, - [NotNullWhen(true)] out T? foundComponent, + [NotNullWhen(true)] ref T? foundComponent, MetaDataComponent? meta = null, TransformComponent? xform = null) where T : IComponent { - foundComponent = default; - if (!MetaQuery.Resolve(uid, ref meta)) return false; @@ -382,7 +380,7 @@ public bool TryFindComponentOnEntityContainerOrParent( if (entityQuery.TryComp(xform.ParentUid, out foundComponent)) return true; - return TryFindComponentOnEntityContainerOrParent(xform.ParentUid, entityQuery, out foundComponent); + return TryFindComponentOnEntityContainerOrParent(xform.ParentUid, entityQuery, ref foundComponent); } ///