Content changes for grid splitting (#7645) (#7746)

Co-authored-by: Vera Aguilera Puerto <gradientvera@outlook.com>
This commit is contained in:
metalgearsloth
2022-04-24 13:54:25 +10:00
committed by GitHub
parent a2da1580d0
commit 72da2db62d
35 changed files with 291 additions and 151 deletions

View File

@@ -22,6 +22,7 @@ namespace Content.Server.NodeContainer.EntitySystems
SubscribeLocalEvent<NodeContainerComponent, ComponentStartup>(OnStartupEvent);
SubscribeLocalEvent<NodeContainerComponent, ComponentShutdown>(OnShutdownEvent);
SubscribeLocalEvent<NodeContainerComponent, AnchorStateChangedEvent>(OnAnchorStateChanged);
SubscribeLocalEvent<NodeContainerComponent, ReAnchorEvent>(OnReAnchor);
SubscribeLocalEvent<NodeContainerComponent, RotateEvent>(OnRotateEvent);
SubscribeLocalEvent<NodeContainerComponent, ExaminedEvent>(OnExamine);
}
@@ -71,6 +72,15 @@ namespace Content.Server.NodeContainer.EntitySystems
}
}
private void OnReAnchor(EntityUid uid, NodeContainerComponent component, ref ReAnchorEvent args)
{
foreach (var node in component.Nodes.Values)
{
_nodeGroupSystem.QueueNodeRemove(node);
_nodeGroupSystem.QueueReflood(node);
}
}
private void OnRotateEvent(EntityUid uid, NodeContainerComponent container, ref RotateEvent ev)
{
if (ev.NewRotation == ev.OldRotation)