Cleanup: Pass in `IComponentFactory in EntityPrototype.TryGetComponent calls inside SharedChameleonProjectorSystem` (#35465)
* Cleanup * Yes
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user