Cleanup: Pass in `IComponentFactory in EntityPrototype.TryGetComponent calls inside SharedChameleonProjectorSystem` (#35465)

* Cleanup

* Yes
This commit is contained in:
Winkarst
2025-02-24 22:45:17 +03:00
committed by GitHub
parent 670791ac49
commit 7fc8dcb811

View 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);
}
}