Subscribe TransformComponent events by-ref (#4478)
This commit is contained in:
committed by
GitHub
parent
bbbebbadf7
commit
ad5f7bb71b
@@ -50,7 +50,7 @@ namespace Content.Server.NodeContainer.EntitySystems
|
||||
private static void OnAnchorStateChanged(
|
||||
EntityUid uid,
|
||||
NodeContainerComponent component,
|
||||
AnchorStateChangedEvent args)
|
||||
ref AnchorStateChangedEvent args)
|
||||
{
|
||||
foreach (var node in component.Nodes.Values)
|
||||
{
|
||||
@@ -59,7 +59,7 @@ namespace Content.Server.NodeContainer.EntitySystems
|
||||
}
|
||||
}
|
||||
|
||||
private static void OnRotateEvent(EntityUid uid, NodeContainerComponent container, RotateEvent ev)
|
||||
private static void OnRotateEvent(EntityUid uid, NodeContainerComponent container, ref RotateEvent ev)
|
||||
{
|
||||
if (ev.NewRotation == ev.OldRotation)
|
||||
{
|
||||
@@ -69,7 +69,7 @@ namespace Content.Server.NodeContainer.EntitySystems
|
||||
foreach (var node in container.Nodes.Values)
|
||||
{
|
||||
if (node is not IRotatableNode rotatableNode) continue;
|
||||
rotatableNode.RotateEvent(ev);
|
||||
rotatableNode.RotateEvent(ref ev);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,6 @@ namespace Content.Server.NodeContainer.Nodes
|
||||
/// <summary>
|
||||
/// Rotates this <see cref="Node"/>.
|
||||
/// </summary>
|
||||
void RotateEvent(RotateEvent ev);
|
||||
void RotateEvent(ref RotateEvent ev);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace Content.Server.NodeContainer.Nodes
|
||||
/// <summary>
|
||||
/// Rotates the <see cref="PipeDirection"/> when the entity is rotated, and re-calculates the <see cref="IPipeNet"/>.
|
||||
/// </summary>
|
||||
void IRotatableNode.RotateEvent(RotateEvent ev)
|
||||
void IRotatableNode.RotateEvent(ref RotateEvent ev)
|
||||
{
|
||||
if (!RotationsEnabled) return;
|
||||
var diff = ev.NewRotation - ev.OldRotation;
|
||||
|
||||
Reference in New Issue
Block a user