@@ -2,7 +2,6 @@
|
||||
using Content.Shared.Construction;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Physics;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
@@ -20,21 +19,21 @@ namespace Content.Server.Construction.Conditions
|
||||
|
||||
public async Task<bool> Condition(IEntity entity)
|
||||
{
|
||||
if (!entity.TryGetComponent(out IPhysBody physics)) return false;
|
||||
if (!entity.TryGetComponent(out IPhysicsComponent physics)) return false;
|
||||
|
||||
return (physics.BodyType == BodyType.Static && Anchored) || (physics.BodyType != BodyType.Static && !Anchored);
|
||||
return physics.Anchored == Anchored;
|
||||
}
|
||||
|
||||
public bool DoExamine(IEntity entity, FormattedMessage message, bool inDetailsRange)
|
||||
{
|
||||
if (!entity.TryGetComponent(out IPhysBody physics)) return false;
|
||||
if (!entity.TryGetComponent(out IPhysicsComponent physics)) return false;
|
||||
|
||||
switch (Anchored)
|
||||
{
|
||||
case true when physics.BodyType == BodyType.Static:
|
||||
case true when !physics.Anchored:
|
||||
message.AddMarkup("First, anchor it.\n");
|
||||
return true;
|
||||
case false when physics.BodyType == BodyType.Static:
|
||||
case false when physics.Anchored:
|
||||
message.AddMarkup("First, unanchor it.\n");
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user