Inline UID
This commit is contained in:
@@ -23,7 +23,7 @@ namespace Content.Shared.Construction.Conditions
|
||||
|
||||
foreach (var entity in location.GetEntitiesInTile(LookupFlags.Approximate | LookupFlags.IncludeAnchored))
|
||||
{
|
||||
if (IoCManager.Resolve<IEntityManager>().HasComponent<SharedCanBuildWindowOnTopComponent>(entity.Uid))
|
||||
if (IoCManager.Resolve<IEntityManager>().HasComponent<SharedCanBuildWindowOnTopComponent>(entity))
|
||||
result = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Content.Shared.Construction.Conditions
|
||||
{
|
||||
foreach (var entity in location.GetEntitiesInTile(LookupFlags.Approximate | LookupFlags.IncludeAnchored))
|
||||
{
|
||||
if (IoCManager.Resolve<IEntityManager>().HasComponent<SharedWindowComponent>(entity.Uid))
|
||||
if (IoCManager.Resolve<IEntityManager>().HasComponent<SharedWindowComponent>(entity))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Content.Shared.Construction.Conditions
|
||||
var entManager = IoCManager.Resolve<IEntityManager>();
|
||||
|
||||
// get blueprint and user position
|
||||
var userWorldPosition = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(user.Uid).WorldPosition;
|
||||
var userWorldPosition = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(user).WorldPosition;
|
||||
var objWorldPosition = location.ToMap(entManager).Position;
|
||||
|
||||
// find direction from user to blueprint
|
||||
@@ -36,7 +36,7 @@ namespace Content.Shared.Construction.Conditions
|
||||
var physics = EntitySystem.Get<SharedPhysicsSystem>();
|
||||
var rUserToObj = new CollisionRay(userWorldPosition, userToObject.Normalized, (int) CollisionGroup.Impassable);
|
||||
var length = userToObject.Length;
|
||||
var userToObjRaycastResults = physics.IntersectRayWithPredicate(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(user.Uid).MapID, rUserToObj, maxLength: length,
|
||||
var userToObjRaycastResults = physics.IntersectRayWithPredicate(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(user).MapID, rUserToObj, maxLength: length,
|
||||
predicate: (e) => !e.HasTag("Wall"));
|
||||
if (!userToObjRaycastResults.Any())
|
||||
return false;
|
||||
@@ -46,7 +46,7 @@ namespace Content.Shared.Construction.Conditions
|
||||
|
||||
// check that we didn't try to build wallmount that facing another adjacent wall
|
||||
var rAdjWall = new CollisionRay(objWorldPosition, direction.ToVec(), (int) CollisionGroup.Impassable);
|
||||
var adjWallRaycastResults = physics.IntersectRayWithPredicate(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(user.Uid).MapID, rAdjWall, maxLength: 0.5f,
|
||||
var adjWallRaycastResults = physics.IntersectRayWithPredicate(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(user).MapID, rAdjWall, maxLength: 0.5f,
|
||||
predicate: (e) => e == targetWall || !e.HasTag("Wall"));
|
||||
return !adjWallRaycastResults.Any();
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Content.Shared.Construction.Steps
|
||||
|
||||
public bool EntityValid(IEntity entity, [NotNullWhen(true)] out SharedStackComponent? stack)
|
||||
{
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(entity.Uid, out SharedStackComponent? otherStack) && otherStack.StackTypeId.Equals(MaterialPrototypeId) && otherStack.Count >= Amount)
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out SharedStackComponent? otherStack) && otherStack.StackTypeId.Equals(MaterialPrototypeId) && otherStack.Count >= Amount)
|
||||
stack = otherStack;
|
||||
else
|
||||
stack = null;
|
||||
|
||||
Reference in New Issue
Block a user