Replace SpriteStateChange construction action with AppearanceChange (#15914)
This commit is contained in:
@@ -90,6 +90,23 @@ namespace Content.Server.Construction
|
||||
return GetCurrentNode(uid, construction) is not {} node ? null : GetEdgeFromNode(node, edgeIndex);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Variant of <see cref="GetCurrentEdge"/> that returns both the node and edge.
|
||||
/// </summary>
|
||||
public (ConstructionGraphNode?, ConstructionGraphEdge?) GetCurrentNodeAndEdge(EntityUid uid, ConstructionComponent? construction = null)
|
||||
{
|
||||
if (!Resolve(uid, ref construction, false))
|
||||
return (null, null);
|
||||
|
||||
if (GetCurrentNode(uid, construction) is not { } node)
|
||||
return (null, null);
|
||||
|
||||
if (construction.EdgeIndex is not {} edgeIndex)
|
||||
return (node, null);
|
||||
|
||||
return (node, GetEdgeFromNode(node, edgeIndex));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the construction graph step the entity is currently at, or null.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user