client/atmos: Fix pipe overlay rotation (#4823)
The Pipe Connection Visualizer failed to account for entity rotation, making the connection overlay sprites appear out of sync with the actual entity connections.
This commit is contained in:
@@ -61,6 +61,8 @@ namespace Content.Client.Atmos.Visualizers
|
||||
{
|
||||
base.OnChangeData(component);
|
||||
|
||||
if (!component.Owner.TryGetComponent<ITransformComponent>(out var xform))
|
||||
return;
|
||||
if (!component.Owner.TryGetComponent<ISpriteComponent>(out var sprite))
|
||||
return;
|
||||
|
||||
@@ -75,7 +77,7 @@ namespace Content.Client.Atmos.Visualizers
|
||||
|
||||
foreach (Layer layerKey in Enum.GetValues(typeof(Layer)))
|
||||
{
|
||||
var dir = (PipeDirection) layerKey;
|
||||
var dir = ((PipeDirection) layerKey).RotatePipeDirection(xform.WorldRotation);
|
||||
var layerVisible = state.ConnectedDirections.HasDirection(dir);
|
||||
|
||||
var layer = sprite.LayerMapGet(layerKey);
|
||||
|
||||
Reference in New Issue
Block a user