Inline one HasComponent overload
This commit is contained in:
@@ -177,7 +177,7 @@ namespace Content.IntegrationTests.Tests
|
||||
|
||||
// The component may already exist if it is a mandatory component
|
||||
// such as MetaData or Transform
|
||||
if (entity.HasComponent(type))
|
||||
if (IoCManager.Resolve<IEntityManager>().HasComponent(entity.Uid, type))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -309,7 +309,7 @@ namespace Content.IntegrationTests.Tests
|
||||
var component = (Component) componentFactory.GetComponent(type);
|
||||
|
||||
// If the entity already has this component, if it was ensured or added by another
|
||||
if (entity.HasComponent(component.GetType()))
|
||||
if (IoCManager.Resolve<IEntityManager>().HasComponent(entity.Uid, component.GetType()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Content.Server.Stack;
|
||||
using Content.Shared.Construction;
|
||||
@@ -228,7 +229,7 @@ namespace Content.Server.Construction.Components
|
||||
{
|
||||
var registration = _componentFactory.GetRegistration(compName);
|
||||
|
||||
if (!part.HasComponent(registration.Type))
|
||||
if (!IoCManager.Resolve<IEntityManager>().HasComponent(part.Uid, registration.Type))
|
||||
continue;
|
||||
|
||||
if (!_componentProgress.ContainsKey(compName))
|
||||
@@ -332,7 +333,7 @@ namespace Content.Server.Construction.Components
|
||||
|
||||
var registration = _componentFactory.GetRegistration(compName);
|
||||
|
||||
if (!eventArgs.Using.HasComponent(registration.Type))
|
||||
if (!IoCManager.Resolve<IEntityManager>().HasComponent(eventArgs.Using.Uid, registration.Type))
|
||||
continue;
|
||||
|
||||
if (!eventArgs.Using.TryRemoveFromContainer() || !_partContainer.Insert(eventArgs.Using)) continue;
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Content.Server.Construction.Conditions
|
||||
|
||||
foreach (var ent in entities)
|
||||
{
|
||||
if (ent.HasComponent(type))
|
||||
if (IoCManager.Resolve<IEntityManager>().HasComponent(ent.Uid, type))
|
||||
return HasEntity;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user