From: Winkarst <74284083+Winkarst-cpu@users.noreply.github.com>
Date: Mon, 24 Feb 2025 19:45:17 +0000 (+0300)
Subject: Cleanup: Pass in ``IComponentFactory`` in ``EntityPrototype.TryGetComponent`` calls...
X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=7fc8dcb811353c3660acb2964cd920903ede08f2;p=space-station-14.git
Cleanup: Pass in ``IComponentFactory`` in ``EntityPrototype.TryGetComponent`` calls inside ``SharedChameleonProjectorSystem`` (#35465)
* Cleanup
* Yes
---
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);
}
}