]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Cleanup: Pass in ``IComponentFactory`` in ``EntityPrototype.TryGetComponent`` calls...
authorWinkarst <74284083+Winkarst-cpu@users.noreply.github.com>
Mon, 24 Feb 2025 19:45:17 +0000 (22:45 +0300)
committerGitHub <noreply@github.com>
Mon, 24 Feb 2025 19:45:17 +0000 (20:45 +0100)
* Cleanup

* Yes

Content.Shared/Polymorph/Systems/SharedChameleonProjectorSystem.cs

index d8f0fc022f1d3ff9bb4caa94e4a0734eda2c2674..69b9bf8f8d43c4738238893dc4d93ded4abf1af8 100644 (file)
@@ -294,19 +294,18 @@ public abstract class SharedChameleonProjectorSystem : EntitySystem
     /// <summary>
     /// Try to get a single component from the source entity/prototype.
     /// </summary>
-    private bool GetSrcComp<T>(ChameleonDisguiseComponent comp, [NotNullWhen(true)] out T? src) where T: Component
+    private bool GetSrcComp<T>(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<EntityPrototype>(protoId, out var proto))
             return false;
 
-        return proto.TryGetComponent(out src);
+        return proto.TryGetComponent(out src, EntityManager.ComponentFactory);
     }
 }