From 7fc8dcb811353c3660acb2964cd920903ede08f2 Mon Sep 17 00:00:00 2001 From: Winkarst <74284083+Winkarst-cpu@users.noreply.github.com> Date: Mon, 24 Feb 2025 22:45:17 +0300 Subject: [PATCH] Cleanup: Pass in ``IComponentFactory`` in ``EntityPrototype.TryGetComponent`` calls inside ``SharedChameleonProjectorSystem`` (#35465) * Cleanup * Yes --- .../Polymorph/Systems/SharedChameleonProjectorSystem.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Content.Shared/Polymorph/Systems/SharedChameleonProjectorSystem.cs b/Content.Shared/Polymorph/Systems/SharedChameleonProjectorSystem.cs index d8f0fc022f..69b9bf8f8d 100644 --- a/Content.Shared/Polymorph/Systems/SharedChameleonProjectorSystem.cs +++ b/Content.Shared/Polymorph/Systems/SharedChameleonProjectorSystem.cs @@ -294,19 +294,18 @@ public abstract class SharedChameleonProjectorSystem : EntitySystem /// /// Try to get a single component from the source entity/prototype. /// - private bool GetSrcComp(ChameleonDisguiseComponent comp, [NotNullWhen(true)] out T? src) where T: Component + private bool GetSrcComp(ChameleonDisguiseComponent comp, [NotNullWhen(true)] out T? src) where T : Component, new() { - src = null; if (TryComp(comp.SourceEntity, out src)) return true; - if (comp.SourceProto is not {} protoId) + if (comp.SourceProto is not { } protoId) return false; if (!_proto.TryIndex(protoId, out var proto)) return false; - return proto.TryGetComponent(out src); + return proto.TryGetComponent(out src, EntityManager.ComponentFactory); } } -- 2.51.2