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>
|
/// <summary>
|
||||||
/// Try to get a single component from the source entity/prototype.
|
/// Try to get a single component from the source entity/prototype.
|
||||||
/// </summary>
|
/// </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))
|
if (TryComp(comp.SourceEntity, out src))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (comp.SourceProto is not {} protoId)
|
if (comp.SourceProto is not { } protoId)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!_proto.TryIndex<EntityPrototype>(protoId, out var proto))
|
if (!_proto.TryIndex<EntityPrototype>(protoId, out var proto))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return proto.TryGetComponent(out src);
|
return proto.TryGetComponent(out src, EntityManager.ComponentFactory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user